home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / fish / 726-750 / 729 / bbbbs / bbbbs54.lzh / rexx / bbsLOCAL.rexx < prev    next >
OS/2 REXX Batch file  |  1992-08-04  |  147KB  |  5,298 lines

  1. /*   $VER: 5.4 bbsLOCAL.rexx 4 Aug 1992 (4.8.92) 7:44PM
  2. copyright 1990-91-92 Richard Lee Stockton FREELY DISTRIBUTABLE
  3.  
  4.            BBBBS.baud without the BaudBandit stuff
  5.    Will multi-task with BBBBS.baud (within limits, see docs)
  6.  
  7. THIS IS THE SYSOP'S VERSION OF BBBBS.baud FOR LOCAL USE ONLY!
  8. */
  9.  
  10. copyright.=''
  11. copyright.1=STRIP(SUBSTR(SOURCELINE(1),3))
  12. copyright.2='
  13. from Gramma Software 17730-15th NE Suite 223 Seattle WA 98155'
  14. copyright.3='
  15. ARexx portions of this software copyright 1990-91-92 Richard Lee Stockton'
  16. copyright.4='- FREELY DISTRIBUTABLE as long as this notice remains -'
  17.  
  18. /* If the QuickSortPort not found then try to run setup.rexx */
  19.  
  20. IF ~show('P','QuickSortPort') THEN CALL setup.rexx()
  21. IF ~show('P','QuickSortPort') THEN EXIT
  22.  
  23. IF SHOW('P','BBBBS_LOCAL') THEN
  24.   DO
  25.     SAY 'bbsLOCAL.rexx is already running!'
  26.     EXIT 0
  27.   END
  28. IF SHOW('P','BBBBS') & GETCLIP('BBS_maint')~='' THEN
  29.   DO
  30.     SAY 'BBS_maint flag is set. Wait until processing is finished, then restart.'
  31.     EXIT 0
  32.   END
  33. CALL SETCLIP('BBS_mainfiles')
  34. CALL SETCLIP('BBS_mainusers')
  35. CALL OPENPORT('BBBBS_LOCAL')
  36.  
  37. PARSE VERSION . . cpu .
  38. cpu=RIGHT(cpu,2)/10
  39. IF cpu<1 THEN cpu=1
  40.  
  41. /* BBS Directories (may be created with SETUP option) */
  42. bbs.=''
  43. bbs.1='Information' /* text files from sysop for the user to read */
  44. bbs.6='Scratch'
  45. bbs.7='BBS_HELP'
  46. bbs.8='rexxDoors'
  47. bbs.9='BBS_TEXT'    /* text files for BBS use. WELCOME HELLO, NEW etc. */
  48. bbs.10='FileNotes'
  49. bbs.11='BBS_LIBS'
  50. bbs.12='BBS_MSGS'
  51. bbs.13='Lists'
  52. bbs.14='Numbers'    /* 1st & last messages, mail, files */
  53. bbs.15='Usage'
  54. bbs.16='Logs'
  55. bbs.17='EMailFiles'
  56. bbs.18='EMail'
  57. bbs.19='Users'
  58.  
  59.  
  60. /* VARIABLES */
  61.  
  62. bbsprefs.=0 /* start with all prefs OFF */
  63. alpha.=''
  64. lastread.=0
  65. dirnum=1
  66. linesperpage=18
  67. sortuserflag=0
  68. sortalphaflag=0
  69. savefileflag=0
  70. emailonline=-1
  71. level=0
  72. lastread.=0
  73. totwrit.=0
  74. lastbrowse=0
  75. warnings=0
  76. winnings=0
  77. nonstop=0
  78. newfilesdate=''
  79. newpassword=''
  80. replysubj=''
  81. msgdir=1
  82. menuflag=1
  83. logonflag=1
  84. data.=''
  85.  
  86.  
  87. /* TEXT - This is the user data structure by line */
  88.  
  89. text.=''
  90. text.1='   Full Name'
  91. text.2='      Street'
  92. text.3='City, ST Zip'
  93. text.4=' Voice Phone'
  94. text.5='    Password'
  95. text.6='    Protocol'
  96. text.7='LinesPerPage'
  97. text.8=' Preferences'
  98. text.9='    Computer'
  99. text.10='   Interests'
  100. text.11='Session Time'
  101. text.12='FirstSession'
  102. text.13='Last Session'
  103. text.14='      UpLoad'
  104. text.15='    Download'
  105. text.16='   Last File'
  106. text.17='Ratio  Email'
  107. text.18='    Winnings'
  108. text.19='       Usage'
  109. text.20='       Level'
  110. text.21='Exclude DIRS'
  111. text.22='   Msgs Read'
  112. text.23='   Msgs Writ'
  113.  
  114.  
  115. /* try to trap everything */
  116.  
  117. SIGNAL ON BREAK_C
  118. OPTIONS RESULTS
  119. OPTIONS FAILAT 10
  120. SIGNAL ON BREAK_E
  121. SIGNAL ON SYNTAX
  122. SIGNAL ON FAILURE
  123. NUMERIC DIGITS 14
  124.  
  125.  
  126. ARG option .
  127.  
  128. SAY CENTER(copyright.1,75)
  129. CALL config()
  130.  
  131. IF ~EXISTS(bbspath'Numbers/FirstLogon') THEN
  132.   ADDRESS COMMAND 'C:Date >'bbspath'Numbers/FirstLogon'
  133.  
  134. SAY CENTER(copyright.2,75)
  135. SAY CENTER(copyright.3,75)
  136. SAY CENTER(copyright.4,75)
  137. SAY
  138.  
  139.  
  140. IF option='SETUP' THEN
  141.   DO
  142.     SAY 'Making sure all needed directories are here...'
  143.     DO i=1 TO 20
  144.       IF bbs.i~='' THEN CALL MAKEDIR(bbspath||bbs.i)
  145.     END
  146.   END
  147.  
  148. CALL colors(1)
  149.  
  150. msg.=''
  151. IF readopen(bbspath'Lists/Conferences') THEN
  152.   DO
  153.     DO i=1
  154.       line=READLN(f)
  155.       IF line='END' THEN BREAK
  156.       IF EOF(f) THEN BREAK
  157.       num=WORD(line,1)
  158.       IF DATATYPE(num,'N') THEN msg.num=WORD(line,2)
  159.     END
  160.     CALL CLOSE(f)
  161.   END
  162. IF option='SETUP' THEN
  163.   DO
  164.     DO i=1 TO 99
  165.       IF msg.i~='' THEN CALL MAKEDIR(msgpath||i)
  166.     END
  167.   END
  168.  
  169. courtesy=''
  170. IF EXISTS(bbspath'Lists/Courtesy') THEN
  171.   DO
  172.     IF readopen(bbspath'Lists/Courtesy') THEN
  173.       DO
  174.         DO i=1
  175.           line=READLN(f)
  176.           IF EOF(f) THEN BREAK
  177.           courtesy=courtesy line
  178.         END
  179.         CALL CLOSE(f)
  180.       END
  181.   END
  182.  
  183. dirs.=''
  184. IF readopen(bbspath'Lists/Libraries') THEN
  185.   DO
  186.     DO i=1
  187.       line=READLN(f)
  188.       IF line='END' | EOF(f) THEN LEAVE i
  189.       num=WORD(line,1)
  190.       IF DATATYPE(num,'N') THEN dirs.num=STRIP(WORD(line,2))
  191.     END
  192.     CALL CLOSE(f)
  193.   END
  194. IF option='SETUP' THEN
  195.   DO
  196.     SAY 'Making sure all file library directories are here...'
  197.     DO i=1 TO 99
  198.       IF dirs.i~='' THEN CALL MAKEDIR(libpath||dirs.i)
  199.     END
  200.   END
  201.  
  202. CALL loaduserlist()
  203. SAY '          The larger the BBS gets, the longer the setup takes...'
  204.  
  205. files.=''
  206. IF readopen(bbspath'Lists/Files') THEN
  207.   DO
  208.     DO i=1
  209.       line=READLN(f)
  210.       IF EOF(f) THEN BREAK
  211.       num=WORD(line,1)
  212.       IF DATATYPE(num,'N') THEN files.num=WORD(line,2) WORD(line,3)
  213.     END
  214.     files.0=i-1
  215.     CALL CLOSE(f)
  216.   END
  217.  
  218. IF readopen(bbspath'Lists/Files.ALPHA') THEN
  219.   DO
  220.     DO i=1
  221.       line=READLN(f)
  222.       IF EOF(f) THEN BREAK
  223.       alpha.i=line
  224.       fnum=WORD(line,3)
  225.       files.fnum.0=i
  226.     END
  227.     alpha.0=i-1
  228.     CALL CLOSE(f)
  229.   END
  230.  
  231. CALL set_grand()
  232.  
  233. BIG_LOOP:
  234. /** Identify (title) message */
  235. IF EXISTS(bbspath'BBS_TEXT/HELLO') THEN
  236.   DO
  237.     SAY 
  238.     arg=bbspath'BBS_TEXT/HELLO'
  239.     CALL readlines(arg 1)
  240.     CALL seelines(0)
  241.   END
  242. SAY
  243. SAY pen3'Courtesy List:'def
  244. SAY courtesy
  245. SAY
  246.  
  247.  
  248. /* Ask for name */
  249. name=''
  250. DO count=1 TO 3
  251.   name=getinput(1 0 'Please enter name: ')
  252.   name=SPACE(name,1,'_')
  253.   IF name='NEW' THEN LEAVE count
  254.   IF name~='' THEN
  255.     DO
  256.       IF FIND(userlist,name)>0 THEN LEAVE count
  257.       IF FIND(exclusion,name)>0 THEN
  258.         DO
  259.           SAY 'Sorry, that is a reserved name.'
  260.           name=''
  261.           ITERATE count
  262.         END
  263.       IF bbsprefs.7>0 | FIND(courtesy,name)>0 THEN
  264.         DO
  265.           SAY
  266.           SAY 'Welcome' name'!'
  267.           SAY 'You will be automatically validated after you enter your user info.'
  268.           SAY
  269.           LEAVE count
  270.         END
  271.     END
  272.   IF count<3 THEN SAY 'New Users please enter NEW to apply for validation.'
  273. END
  274. IF count>3 THEN SIGNAL DONE
  275. CALL checkUser()
  276. CALL checkclips()
  277. city=docity(data.3)
  278.  
  279.  
  280. /* Opening Display after logon. Seen by all Users ONCE A DAY. It first  */
  281. /* looks for a unique yearly data (ie, WELCOME.0704), then daily data   */
  282. /* (ie, WELCOME.Fri), and finally a simple, everyday 'WELCOME' datafile */
  283.  
  284. IF DATE('I')>lastondate THEN
  285.   DO
  286.     arg=bbspath'BBS_TEXT/WELCOME.'RIGHT(DATE('S'),4)
  287.     IF ~EXISTS(arg) THEN
  288.       DO
  289.         arg=bbspath'BBS_TEXT/WELCOME.'LEFT(DATE('W'),3)
  290.         IF ~EXISTS(arg) THEN arg=bbspath'BBS_TEXT/WELCOME'
  291.       END
  292.     IF EXISTS(arg) THEN
  293.       DO
  294.         SAY 
  295.         CALL showtext(arg)
  296.         nonstop=0
  297.       END
  298.  
  299. /*
  300. Looks for format UNTIL.YYYYMMDD ie, "UNTIL.19920514"
  301. Deletes any that are previous to "today"
  302. */
  303.  
  304.     untils.=''
  305.     IF FileList(bbspath'BBS_TEXT/UNTIL.*',untils)>0 THEN
  306.       DO
  307.         CALL QSORT(1,untils.0,untils)
  308.         DO ui=1 TO untils.0
  309.           IF RIGHT(untils.ui,8)<DATE('S') THEN CALL DELETE(untils.ui)
  310.           ELSE
  311.             DO
  312.               SAY
  313.               CALL showtext(untils.ui)
  314.               nonstop=0
  315.             END
  316.         END
  317.       END
  318.     DROP untils.
  319.  
  320.     IF UPPER(WORD(data.12,3))~='BIRTHDAY:' THEN
  321.       DO
  322.         SAY
  323.         SAY 'Please help us out by entering the following information.'
  324.         CALL getbirth()
  325.         SAY '   Thank you!'
  326.       END
  327.   END
  328.  
  329. IF RIGHT(WORD(data.12,4),4)=RIGHT(DATE('S'),4) THEN
  330.   DO
  331.     arg=bbspath'BBS_TEXT/BIRTHDAY'
  332.     IF EXISTS(arg) THEN 
  333.       DO
  334.         SAY
  335.         CALL showtext(arg)
  336.         nonstop=0
  337.       END
  338.     SAY
  339.     SAY '***  Happy Birthday,' pen3||data.1||def', and many more!  ***'
  340.     SAY
  341.   END
  342. SAY 
  343.  
  344. IF bbsprefs.1 & ~terseflag THEN
  345.   DO
  346.     IF doGrin()>3 THEN CALL waiting()
  347.     IF EXISTS(bbspath'rexxDoors/Moon.rexx') THEN CALL Moon.rexx()
  348.     IF EXISTS(bbspath'rexxDoors/Time.rexx') THEN CALL Time.rexx()
  349.     IF FIND(UPPER(SHOWLIST('A')),'TODAY')>0 THEN
  350.       DO
  351.         IF EXISTS('RAM:TODAY') THEN
  352.           DO
  353.             finfo=STATEF('RAM:TODAY')
  354.             IF WORD(finfo,5)~=DATE('I') THEN
  355.               ADDRESS COMMAND 'C:Today091 >RAM:TODAY'
  356.           END
  357.         ELSE ADDRESS COMMAND 'C:Today091 >RAM:TODAY'
  358.         IF EXISTS('RAM:TODAY') THEN
  359.           DO
  360.             CALL readlines('RAM:TODAY' 1)
  361.             CALL seelines(0)
  362.           END
  363.       END
  364.     SAY
  365.   END
  366. CALL sortlibraries()
  367.  
  368. CALL TIME('R')
  369.  
  370. CALL readmail(0)
  371. lastbrowse=WORD(data.16,1)
  372. IF ~DATATYPE(lastbrowse,'N') THEN lastbrowse=0
  373. IF ~terseflag THEN
  374.   DO
  375.     IF level>sysoplevel THEN
  376.       DO
  377.         lstmail=WORD(data.17,3)
  378.         IF ~DATATYPE(lstmail,'N') THEN lstmail=0
  379.         IF countcheck(bbspath'Numbers/LastMail' 0)>lstmail THEN
  380.           IF getinput(1 1 'Check Email? (Ny) > ')='Y' THEN CALL mailreport()
  381.         IF level<99 THEN
  382.           DO
  383.             SAY
  384.             CALL showtext(bbspath'Email/'sysop'/NEW_FILES')
  385.           END
  386.         SAY
  387.         CALL showtext(bbspath'Lists/NEW_USERS')
  388.       END
  389.     CALL logonstats()
  390.     CALL newinfo()
  391.   END
  392. CALL showmarked()
  393. CALL setdir(libpath||dirs.1)
  394. logonflag=0
  395.  
  396.  
  397. /***** MAIN *****/
  398.  
  399. IF menu~='ALL' THEN menu='MAIN'
  400.  
  401. RESTART:
  402. SIGNAL ON BREAK_C
  403. SIGNAL ON BREAK_E
  404. OPTIONS FAILAT 25
  405.  
  406. waitchar=''
  407. string=''
  408. opt=''
  409. IF level<1 THEN menu='NEW'
  410. DO WHILE(opt~='G')
  411.   go=0
  412.   DO WHILE(~go)
  413.     IF waitchar='' | waitchar='?' THEN
  414.       DO
  415.         commands='cghiqsvwxyz!#,'
  416.         IF level>0  THEN commands='abcdefghijlmnoprstuvwxyz!$#&.,+'
  417.         IF level>sysoplevel THEN commands=commands'k%^()=;'
  418.         IF level=99 THEN commands=commands'@~'
  419.         commands=commands'?'
  420.         IF menuflag | waitchar='?' | string='?' THEN
  421.           DO
  422.             opt='MENU'
  423.             arg=''
  424.             CALL menus()
  425.           END
  426.         ELSE SAY pen3'COMMANDS:'def commands
  427.       END
  428.     line=''
  429.     line=line||bak2' 'TIME('C')' 'def
  430.     IF menu='ALL' | menu='FILE' THEN
  431.       line=line pen3'FILE_LIBRARY:'plaindir||def
  432.     ELSE IF menu='MSG' THEN line=line pen3'MESSAGES:'def
  433.     ELSE line=line pen3'MAIN:'def
  434.     IF waitchar='' THEN waitchar=getinput(0 0 line' > ')
  435.     PARSE VAR waitchar string' 'arg
  436.     nonstop=0
  437.     string=UPPER(STRIP(string))
  438.     IF string='OFF' | string='BYE' THEN SIGNAL LOGOUT
  439.     waitchar=''
  440.     IF DATATYPE(string,'N') THEN
  441.       DO
  442.         dirnum=string
  443.         CALL chdir2()
  444.         CALL since()
  445.       END
  446.     opt=left(string,1)
  447.     go=1    /* check for access */
  448.     IF POS(opt,UPPER(commands))=0 THEN go=0
  449.   END
  450.   OPTIONS PROMPT 'Filename: '
  451.   SELECT
  452.     WHEN(opt='A') THEN CALL showalpha()
  453.     WHEN(opt='B') THEN CALL browse()
  454.     WHEN(opt='C') THEN CALL editor('MAIL' sysop)
  455.     WHEN(opt='D') THEN CALL dload()
  456.     WHEN(opt='E') THEN CALL readmail(1)
  457.     WHEN(opt='F') THEN IF menu~='ALL' THEN menu='FILE'
  458.     WHEN(opt='H') THEN CALL help('MAIN')
  459.     WHEN(opt='I') THEN CALL information()
  460.     WHEN(opt='J') THEN CALL jump2rexx()
  461.     WHEN(opt='K') THEN CALL killuser()
  462.     WHEN(opt='L') THEN CALL list()
  463.     WHEN(opt='M') THEN IF menu~='ALL' THEN menu='MSG'
  464.     WHEN(opt='N') THEN CALL newfiles()
  465.     WHEN(opt='O') THEN CALL otheruser()
  466.     WHEN(opt='P') THEN CALL editor('MSG')
  467.     WHEN(opt='R') THEN CALL readmessages()
  468.     WHEN(opt='S') THEN CALL bbsSEARCH()
  469.     WHEN(opt='U') THEN CALL uload(1)
  470.     WHEN(opt='V') THEN CALL showtext(bbspath'Usage/USER.LOG')
  471.     WHEN(opt='W') THEN CALL showuserlist()
  472.     WHEN(opt='X') THEN CALL switchmenuflag()
  473.     WHEN(opt='Y') THEN CALL edituser()
  474.     WHEN(opt='Z') THEN CALL counts()
  475.     WHEN(opt='~') THEN CALL sysED(1)
  476.     WHEN(opt='@') THEN CALL shell()
  477.     WHEN(opt='#') THEN CALL switchcolors()
  478.     WHEN(opt='$') THEN IF menu='ALL' THEN menu='MAIN'; ELSE menu='ALL'
  479.     WHEN(opt='%') THEN CALL editnote()
  480.     WHEN(opt='^') THEN CALL readlogs()
  481.     WHEN(opt='&') THEN CALL profiles()
  482.     WHEN(opt=';') THEN CALL changename()
  483.     WHEN(opt='(') THEN CALL filereport()
  484.     WHEN(opt=')') THEN CALL mailreport()
  485.     WHEN(opt='=') THEN CALL levelreport()
  486.     WHEN(opt='+') THEN CALL ext_dload()
  487.     WHEN(opt='.') THEN menu='MAIN'
  488.     WHEN(opt=',') THEN DO;CALL hourly();CALL waiting();END
  489.     WHEN(opt='?') & menuflag THEN CALL help('MAIN')
  490.     OTHERWISE NOP
  491.   END
  492. END
  493. SIGNAL LOGOUT
  494. EXIT;       /* an extra margin of safety */
  495.  
  496.  
  497. /* FUNCTIONS */
  498.  
  499. showtext:
  500. PARSE ARG arg .
  501. IF EXISTS(arg) THEN
  502.   DO
  503.     CALL readlines(arg 1)
  504.     CALL seelines(1)
  505.     nonstop=0
  506.     CALL waiting()
  507.   END
  508. RETURN
  509.  
  510.  
  511. doGrin:
  512. IF ~EXISTS(bbspath'rexxDoors/Grin_du_Jour.rexx') THEN RETURN 0
  513. CALL setdir(bbspath'rexxDoors')
  514. temp=Grin_du_Jour.rexx()
  515. SAY
  516. RETURN temp
  517.  
  518.  
  519. killuser:
  520. IF level<=sysoplevel THEN RETURN
  521. killcount=0
  522. DO loop=1
  523.   IF arg='' THEN
  524.     DO
  525.       OPTIONS PROMPT 'RETURN=QUIT  Username to Kill: '
  526.       PULL arg
  527.     END
  528.   IF STRIP(arg)='' THEN LEAVE loop
  529.   arg=UPPER(arg)
  530.   arg=SPACE(STRIP(arg),1,'_')
  531.   IF getinput(1 1 'Really kill' arg'? (nY) > ')='N' THEN
  532.     DO
  533.       arg=''
  534.       ITERATE loop
  535.     END
  536.   SAY 'Working...'
  537.   IF readlines(bbspath'Users/'arg 1) THEN
  538.     DO
  539.       SAY 'User' arg 'not found.'
  540.       arg=''
  541.       ITERATE loop
  542.     END
  543.   IF level<=lynes.20 THEN
  544.     DO
  545.       SAY '*** Tsk! Tsk!  Your level is not greater than' arg'.'
  546.       arg=''
  547.       ITERATE loop
  548.     END
  549.   CALL DELETE(bbspath'Users/'arg)
  550.   IF EXISTS(bbspath'Email/'arg) THEN
  551.     DO
  552.       temp=WORDS(SHOWDIR(bbspath'Email/'arg))
  553.       emailonline=emailonline-temp
  554.       ADDRESS COMMAND 'C:DELETE >*' bbspath'Email/'arg 'ALL'
  555.     END
  556.   IF EXISTS(bbspath'EmailFiles/'arg) THEN
  557.     ADDRESS COMMAND 'C:DELETE >*' bbspath'EmailFiles/'arg 'ALL'
  558.   SAY 'User file, Email & EmailFiles for' arg 'have been deleted.'
  559.   killcount=killcount+1
  560.   arg=''
  561. END
  562. IF killcount=0 THEN RETURN
  563. CALL DELETE(bbspath'Lists/USERS')
  564. sortuserflag=1
  565. RETURN
  566.  
  567.  
  568. menus:
  569. SAY
  570. IF menu='NEW' THEN
  571. DO
  572.   SAY pen6'     _________________'def
  573.   SAY pen6'  __/  'pen3'New User Menu'pen6'  \___'def
  574.   SAY pen6' |                        |'def
  575.   SAY pen6' |'def'   ['pen3'H'def']elp               'pen6'|'def
  576.   SAY pen6' |'def'   ['pen3'I'def']nformation        'pen6'|'def
  577.   SAY pen6' |'def'   ['pen3'Y'def']our user data     'pen6'|'def
  578.   SAY pen6' |'def'   ['pen3'W'def']ho is here        'pen6'|'def
  579.   SAY pen6' |'def'   ['pen3'S'def']earch user list   'pen6'|'def
  580.   SAY pen6' |'def'   ['pen3'V'def']iew user log      'pen6'|'def
  581.   SAY pen6' |'def'   ['pen3'Z'def'] bbs statistics   'pen6'|'def
  582.   SAY pen6' |'def'   ['pen3','def'] hourly stats     'pen6'|'def
  583.   SAY pen6' |'def'   ['pen3'X'def'] toggle menus     'pen6'|'def
  584.   SAY pen6' |'def'   ['pen3'#'def'] toggle color     'pen6'|'def
  585.   SAY pen6' |'def'   ['pen3'!'def'] YELL for SYSOP   'pen6'|'def
  586.   SAY pen6' |'def'   ['pen3'C'def']omment to SYSOP   'pen6'|'def
  587.   SAY pen6' |'def'   ['pen3'G'def']oodbye (hangup)   'pen6'|'def
  588.   SAY pen6' |________________________|'def
  589. END
  590. ELSE IF menu='MSG' THEN
  591. DO
  592.     SAY pen6'       ____________'def
  593.     SAY pen6'  ____/  'pen3'Messages'pen6'  \_____'def
  594.     SAY pen6' |                       |'def
  595.     SAY pen6' |'def'   ['pen3'H'def']elp              'pen6'|'def
  596.     SAY pen6' |'def'   ['pen3'P'def']ost messages     'pen6'|'def
  597.     SAY pen6' |'def'   ['pen3'R'def']ead messages     'pen6'|'def
  598.     SAY pen6' |'def'   ['pen3'S'def']earch messages   'pen6'|'def
  599.     SAY pen6' |'def'   ['pen3'E'def']mail (private)   'pen6'|'def
  600.     SAY pen6' |'def'   ['pen3'C'def']omment to SYSOP  'pen6'|'def
  601.     SAY pen6' |'def'   ['pen3'!'def'] YELL for SYSOP  'pen6'|'def
  602. IF(level>sysoplevel) THEN DO
  603.     SAY pen6' |'def'   ['pen3'^'def'] view BBS logs   'pen6'|'def
  604.     SAY pen6' |'def'   ['pen3')'def'] email report    'pen6'|'def
  605.     SAY pen6' |'def'   ['pen3'='def'] level report    'pen6'|'def
  606.     SAY pen6' |'def'   ['pen3';'def'] change username 'pen6'|'def;END
  607. IF(level=99) THEN DO
  608.     SAY pen6' |'def'   ['pen3'~'def'] online editor   'pen6'|'def
  609.     SAY pen6' |'def'   ['pen3'@'def'] dos shell       'pen6'|'def;END
  610.     SAY pen6' |'def'   ['pen3'F'def']iles menu        'pen6'|'def
  611.     SAY pen6' |'def'   ['pen3'.'def'] main menu       'pen6'|'def
  612.     SAY pen6' |_______________________|'def
  613. END
  614. ELSE IF menu='FILE' THEN
  615. DO
  616.     SAY pen6'         _________'def
  617.     SAY pen6'  ______/  'pen3'Files'pen6'  \_______'def
  618.     SAY pen6' |                        |'def
  619.     SAY pen6' |'def'   ['pen3'A'def']lphabetic list    'pen6'|'def
  620.     SAY pen6' |'def'   ['pen3'H'def']elp               'pen6'|'def
  621.     SAY pen6' |'def'   ['pen3'B'def']rowse files       'pen6'|'def
  622.     SAY pen6' |'def'   ['pen3'N'def']ew files list     'pen6'|'def
  623.     SAY pen6' |'def'   ['pen3'L'def']ist files         'pen6'|'def
  624.     SAY pen6' |'def'   ['pen3'S'def']earch files       'pen6'|'def
  625.     SAY pen6' |'def'   ['pen3'V'def']iew user log      'pen6'|'def
  626.     SAY pen6' |'def'   ['pen3'U'def']pload             'pen6'|'def
  627.     SAY pen6' |'def'   ['pen3'D'def']ownload           'pen6'|'def
  628.     SAY pen6' |'def'   ['pen3'+'def'] Extra Devices    'pen6'|'def
  629. IF(level>sysoplevel) THEN DO
  630.     SAY pen6' |'def'   ['pen3'K'def']ill a user        'pen6'|'def
  631.     SAY pen6' |'def'   ['pen3'%'def'] edit filenote    'pen6'|'def
  632.     SAY pen6' |'def'   ['pen3'('def'] file report      'pen6'|'def
  633.     SAY pen6' |'def'   ['pen3';'def'] change username  'pen6'|'def;END
  634. IF(level=99) THEN
  635.     SAY pen6' |'def'   ['pen3'@'def'] dos shell        'pen6'|'def
  636.     SAY pen6' |'def'   ['pen3'M'def']essages menu      'pen6'|'def
  637.     SAY pen6' |'def'   ['pen3'.'def'] main menu        'pen6'|'def
  638.     SAY pen6' |________________________|'def
  639. END
  640. ELSE IF menu='MAIN' THEN
  641. DO
  642.     SAY pen6'       _____________'def
  643.     SAY pen6'  ____/  'pen3'Main Menu'pen6'  \_____'def
  644.     SAY pen6' |                        |'def
  645.     SAY pen6' |'def'   ['pen3'H'def']elp               'pen6'|'def
  646.     SAY pen6' |'def'   ['pen3'I'def']nfomation         'pen6'|'def
  647.     SAY pen6' |'def'   ['pen3'J'def']ump to doorways   'pen6'|'def
  648.     SAY pen6' |'def'   ['pen3'Y'def']our user data     'pen6'|'def
  649.     SAY pen6' |'def'   ['pen3'W'def']ho is here list   'pen6'|'def
  650.     SAY pen6' |'def'   ['pen3'S'def']earch userlist    'pen6'|'def
  651.     SAY pen6' |'def'   ['pen3'O'def']ther users info   'pen6'|'def
  652.     SAY pen6' |'def'   ['pen3'X'def']pert (no menus)   'pen6'|'def
  653.     SAY pen6' |'def'   ['pen3'#'def'] toggle colors    'pen6'|'def
  654.     SAY pen6' |'def'   ['pen3'$'def'] toggle menu(s)   'pen6'|'def
  655.     SAY pen6' |'def'   ['pen3'&'def'] user profiles    'pen6'|'def
  656.     SAY pen6' |'def'   ['pen3'Z'def'] bbs statistics   'pen6'|'def
  657.     SAY pen6' |'def'   ['pen3'G'def']oodbye (hangup)   'pen6'|'def
  658.     SAY pen6' |'def'   ['pen3'F'def']iles menu         'pen6'|'def
  659.     SAY pen6' |'def'   ['pen3'M'def']essages menu      'pen6'|'def
  660.     SAY pen6' |________________________|'def
  661. END
  662. ELSE IF menu='ALL' THEN
  663. DO
  664.     SAY pen6'     __________________________________________________________'def
  665.     SAY pen6'  __/   'pen3'Main Menu            File Menu          Message Menu 'pen6'  \__'def
  666.     SAY pen6' |                                                                |'def
  667.     SAY pen6' |'def' ['pen3'H'def']elp               ['pen3'A'def']lphabetical list  ['pen3'P'def']ost messages      'pen6'|'def
  668.     SAY pen6' |'def' ['pen3'I'def']nformation        ['pen3'B'def']rowse filenotes   ['pen3'R'def']ead messages      'pen6'|'def
  669.     SAY pen6' |'def' ['pen3'Z'def'] bbs statiZtics   ['pen3'L'def']ist by Library    ['pen3'E'def']mail (private)    'pen6'|'def
  670.     SAY pen6' |'def' ['pen3'Y'def']our user data     ['pen3'N'def']ew files          ['pen3'C'def']omment to SYSOP   'pen6'|'def
  671.     SAY pen6' |'def' ['pen3'O'def']ther users info   ['pen3'D'def']ownload           ['pen3'!'def'] YELL for SYSOP   'pen6'|'def
  672.     SAY pen6' |'def' ['pen3'J'def']ump to doorways   ['pen3'U'def']pload             ['pen3'X'def']pert (no menus)   'pen6'|'def
  673.     SAY pen6' |'def' ['pen3'S'def']earch menu        ['pen3'T'def']ransfer protocol  ['pen3'$'def'] toggle menu(s)   'pen6'|'def
  674.     SAY pen6' |'def' ['pen3'&'def'] user profiles    ['pen3'+'def'] Extra Devices    ['pen3'#'def'] toggle colors    'pen6'|'def
  675.     SAY pen6' |'def' ['pen3'G'def']oodbye (logoff)   ['pen3'V'def']iew user log      ['pen3','def'] hourly stats     'pen6'|'def
  676. IF(level>sysoplevel) THEN DO
  677.     SAY pen6' |'def' ['pen3'K'def']ill a user        ['pen3'%'def'] edit filenote    ['pen3'='def'] level report     'pen6'|'def
  678.     SAY pen6' |'def' ['pen3'^'def'] view BBS logs    ['pen3'('def'] file report      ['pen3';'def'] change username  'pen6'|'def;END
  679. IF(level=99) THEN
  680.     SAY pen6' |'def' ['pen3'~'def'] online editor    ['pen3'@'def'] dos shell        ['pen3')'def'] email report     'pen6'|'def
  681.     SAY pen6' |________________________________________________________________|'def
  682. END
  683. SAY
  684. RETURN
  685.  
  686.  
  687. help:
  688. ARG helppath .
  689. SAY
  690. SAY 'For more detailed help, use ['pen3'I'def']nformation commmand to read BBBBS.COMMANDS.'
  691. IF helppath='MAIN' THEN
  692.   SAY 'Commands available from the' pen3||menu||def 'menu:'
  693. frontend=bbspath'BBS_HELP/'helppath
  694. backend='.USER'
  695. IF level=0 THEN backend='.NEW'
  696. ELSE IF level=99 THEN backend='.SUPER'
  697. ELSE IF level>sysoplevel THEN backend='.SYSOP'
  698. CALL showtext(frontend||backend)
  699. RETURN
  700.  
  701.  
  702. waiting:
  703. IF waitchar='Q' THEN
  704.   DO
  705.     waitchar=''
  706.     RETURN
  707.   END
  708. waitchar=''
  709. IF nonstop=1 THEN RETURN
  710. OPTIONS PROMPT pen3'                       RETURN=Continue  'def
  711. PULL waitchar
  712. CALL cleanline(1)
  713. RETURN
  714.  
  715.  
  716. waiting2:
  717. IF nonstop=1 THEN RETURN 0
  718. waitchar=getinput(1 1 pen3'   Q=Quit   N=Non-Stop   RETURN=Continue  'def)
  719. IF waitchar='N' THEN
  720.   DO
  721.     nonstop=1
  722.     SAY pen3'To EXIT non-stop scrolling of text, press CTRL-E        'def
  723.     SAY
  724.     CALL DELAY(100)
  725.     waitchar=''
  726.   END
  727. CALL cleanline(1)
  728. IF waitchar='Q' THEN RETURN 1
  729. RETURN 0
  730.  
  731.  
  732. cleanline:
  733. ARG lflag .
  734. IF colorflag~=1 & lflag=1 THEN RETURN
  735. cline=lineup||LEFT(' ',77)
  736. IF lflag=1 THEN cline=cline||lineup
  737. SAY cline
  738. RETURN
  739.  
  740.  
  741. getinput:
  742. PARSE ARG upflag' 'oneflag' 'pline
  743. OPTIONS PROMPT pline
  744. PARSE PULL inarg
  745. inarg=STRIP(inarg)
  746. IF upflag THEN inarg=UPPER(inarg)
  747. IF oneflag THEN inarg=LEFT(inarg,1)
  748. RETURN inarg
  749.  
  750.  
  751. docity:
  752. PARSE ARG citi
  753. citi=TRANSLATE(citi,'          ','+-.,*/()<>')
  754. DO i=WORDS(citi) TO 1 BY -1
  755.   IF DATATYPE(WORD(citi,i),'N') THEN citi=STRIP(DELWORD(citi,i,1))
  756.   IF UPPER(WORD(citi,i))='USA' THEN citi=STRIP(DELWORD(citi,i,1))
  757. END
  758. citi=SPACE(citi,1)
  759. RETURN STRIP(citi)
  760.  
  761.  
  762. setdir:
  763. PARSE ARG tempdir
  764. CALL PRAGMA('D',STRIP(tempdir))
  765. directory=PRAGMA('D')
  766. slash=LASTPOS('/',directory)
  767. IF slash=0 THEN slash=LASTPOS(':',directory)
  768. plaindir=directory
  769. IF slash>0 THEN plaindir=SUBSTR(plaindir,slash+1)
  770. RETURN
  771.  
  772.  
  773. config:
  774. arg='s:CONFIG.BBS'
  775. IF ~EXISTS(arg) THEN arg='BBS:BBS_TEXT/CONFIG.BBS'
  776. IF readlines(arg 1) THEN
  777.   DO
  778.     SAY 's:CONFIG.BBS and BBS:BBS_TEXT/CONFIG.BBS are both missing!'
  779.     SIGNAL DONE2
  780.   END
  781. compos=POS('/*',lynes.1)
  782. IF compos>0 THEN lynes.1=LEFT(lynes.1,compos-1)
  783. bbsname=STRIP(lynes.1)
  784. sysop=WORD(lynes.2,1)
  785. compos=POS('/*',lynes.3)
  786. IF compos>0 THEN lynes.3=LEFT(lynes.3,compos-1)
  787. exclusion=STRIP(lynes.3)
  788. bbsdevice=WORD(lynes.4,1)
  789. sysoplevel=WORD(lynes.5,1)
  790. bbspath=WORD(lynes.6,1)
  791. IF ~EXISTS(bbspath) THEN
  792.   DO
  793.     SAY bbspath 'does not exist!'
  794.     SIGNAL DONE2
  795.   END
  796. testchar=RIGHT(bbspath,1)
  797. IF testchar~='/' & testchar~=':' THEN bbspath=bbspath'/'
  798. CALL SETCLIP('BBS_path',bbspath)
  799. msgpath=WORD(lynes.7,1)
  800. IF ~EXISTS(msgpath) THEN
  801.   DO
  802.     SAY msgpath 'does not exist!'
  803.     SIGNAL DONE2
  804.   END
  805. testchar=RIGHT(msgpath,1)
  806. IF testchar~='/' & testchar~=':' THEN msgpath=msgpath'/'
  807. CALL SETCLIP('BBS_msgpath',msgpath)
  808. msgpath=msgpath'MSG'
  809. libpath=WORD(lynes.8,1)
  810. IF ~EXISTS(libpath) THEN
  811.   DO
  812.     SAY libpath 'does not exist!'
  813.     SIGNAL DONE2
  814.   END
  815. testchar=RIGHT(libpath,1)
  816. IF testchar~='/' & testchar~=':' THEN libpath=libpath'/'
  817. CALL SETCLIP('BBS_libpath',libpath)
  818. spellpath=WORD(lynes.9,1)
  819. IF bbsprefs.5 & ~EXISTS(spellpath) THEN
  820.   DO
  821.     SAY spellpath 'does not exist!'
  822.     bbsprefs.5=0
  823.   END
  824. extdevs=''
  825. DO i=1 TO WORDS(lynes.10)
  826.   test=WORD(lynes.10,i)
  827.   IF POS(':',test)=0 THEN ITERATE i
  828.   IF LEFT(test,2)='/*' THEN LEAVE i
  829.   extdevs=STRIP(extdevs test)
  830. END
  831. SYSTEM_MSG_LIMIT=WORD(lynes.11,1)
  832. SYSTEM_SPACE_LIMIT=WORD(lynes.12,1)
  833. maxidle=WORD(lynes.13,1)
  834. maxtime=WORD(lynes.14,1)
  835. maxbps=WORD(lynes.15,1)
  836. IF ~DATATYPE(maxbps,'N') THEN maxbps=2400
  837. CALL SETCLIP('BBS_baud',maxbps)
  838. DO i=16 TO 31
  839.   j=i-15
  840.   bbsprefs.j=STRIP(WORD(lynes.i,1))
  841. END
  842. IF bbsprefs.5 & ~EXISTS(spellpath) THEN
  843.   DO
  844.     SAY spellpath 'does not exist!'
  845.     bbsprefs.5=0
  846.   END
  847. IF bbsprefs.10 THEN scratch=bbspath'Scratch'
  848. ELSE scratch='RAM:Scratch'
  849. CALL MAKEDIR(scratch)
  850. IF ~DATATYPE(bbsprefs.16,'N') THEN bbsprefs.16=3
  851. extension=WORD(lynes.32,1)
  852. arccom=lynes.33
  853. compos=POS('/*',lynes.33)
  854. IF compos>0 THEN lynes.33=LEFT(lynes.33,compos-1)
  855. arccom=STRIP(lynes.33)
  856. IF LEFT(extension,1)~='.' THEN
  857.   DO
  858.     extension='.lzh'
  859.     arccom='lharc -m m'
  860.   END
  861. RETURN
  862.  
  863.  
  864. readlogs:
  865. IF arg='' THEN
  866.   arg=getinput(1 0 '['pen3'RETURN'def']=TODAY, or enter Log Date ('pen3||DATE('S')||def') > ')
  867. IF arg='' THEN arg=DATE('S')
  868. arg=bbspath'Logs/log.'arg
  869. CALL readlines(arg 1)
  870. CALL seelines(0)
  871. nonstop=0
  872. CALL waiting()
  873. RETURN
  874.  
  875.  
  876. loadcourtesy:
  877. IF courtesyflag=0 & courtesy='' & EXISTS(bbspath'Lists/Courtesy') THEN
  878.   DO
  879.     IF readopen(bbspath'Lists/Courtesy') THEN
  880.       DO
  881.         SAY 'Checking Courtesy List...'
  882.         DO i=1
  883.           line=READLN(f)
  884.           IF EOF(f) THEN BREAK
  885.           courtesy=courtesy UPPER(line)
  886.         END
  887.         CALL CLOSE(f)
  888.         MSG ''
  889.         MSG pen3'Courtesy List:'def
  890.         MSG courtesy
  891.       END
  892.   END
  893. RETURN
  894.  
  895.  
  896. fileheader:
  897. SAY 'Filename          Bytes File# Library         KeyWords'
  898. SAY pen3||LEFT('=',77,'=')||def
  899. RETURN
  900.  
  901.  
  902. showalpha:
  903. IF DATATYPE(arg,'N') THEN
  904.   DO
  905.     dirnum=arg
  906.     arg=''
  907.     IF chdir2()>0 THEN RETURN
  908.     test='Y'
  909.   END
  910. ELSE
  911.   DO
  912.     test=getinput(1 1 'Show one library only? (Ny) > ')
  913.     IF test='Y' THEN
  914.       IF chdir()>0 THEN RETURN
  915.   END
  916.  
  917. showalpha2:
  918. IF test='Y' THEN filecount=WORDS(SHOWDIR(bbspath'FileNotes/'plaindir))
  919. ELSE filecount=files.0
  920. SAY '  'filecount 'files.'
  921. CALL fileheader()
  922. count=0
  923. DO shi=1 TO alpha.0
  924.   IF test='Y' THEN
  925.     DO
  926.       IF count>=filecount THEN LEAVE shi
  927.       IF UPPER(LEFT(plaindir,12))~=UPPER(LEFT(WORD(alpha.shi,5),12)) THEN
  928.         ITERATE shi
  929.     END
  930.   jj=WORD(alpha.shi,4)
  931.   IF jj>level | FIND(data.21,UPPER(dirs.jj))>0 THEN
  932.     ITERATE shi
  933.   SAY LEFT(alpha.shi,76)
  934.   count=count+1
  935.   IF (count+2)//linesperpage=0 THEN
  936.     IF waiting2() THEN LEAVE shi
  937. END
  938. nonstop=0
  939. IF waitchar~='Q' THEN CALL waiting()
  940. RETURN
  941.  
  942.  
  943. profiles:
  944. prodir=bbspath'Profiles'
  945. CALL MAKEDIR(prodir)
  946. pros=SHOWDIR(prodir)
  947. protxt=bbspath'BBS_TEXT/PROFILES'
  948. IF EXISTS(protxt) THEN CALL showtext(protxt)
  949. DO lupe=1
  950.   SAY
  951.   SAY '     1. Edit 'name'''s User Profile'
  952.   SAY '     2. View a User Profile'
  953.   SAY '     3. Search User Profiles'
  954.   SAY '     4. Browse User Profiles'
  955.   SAY
  956.   temp=getinput(1 1 'Enter Selection Number > ')
  957.   IF temp=1 THEN
  958.     DO
  959.       lynes.=''
  960.       IF EXISTS(prodir'/'name) THEN
  961.         DO
  962.           IF readlines(prodir'/'name 1)~=0 THEN ITERATE lupe
  963.           CALL DELETE(prodir'/'name)
  964.         END
  965.       ELSE lynes.0=3
  966.       lynes.1=name
  967.       lynes.2='Profile Last Updated:' DATE('W') DATE() TIME('C')
  968.       lynes.3=LEFT('=',74,'=')
  969.       IF savelines(prodir'/'name)~=0 THEN
  970.         DO
  971.           line='Profile for' name 'failed to save!'
  972.           SAY line
  973.           CALL send2log(line)
  974.           ITERATE lupe
  975.         END
  976.       edtype=''
  977.       CALL bbsEd(4 prodir'/'name)
  978.       IF readlines(prodir'/'name 1)~=0 THEN CALL DELETE(prodir'/'name)
  979.       IF lynes.0<4 THEN CALL DELETE(prodir'/'name)
  980.       pros=SHOWDIR(prodir)
  981.     END
  982.   ELSE IF temp=2 THEN
  983.     DO pf=1
  984.       totpros=WORDS(pros)
  985.       DO pfl=1 TO totpros BY 3
  986.         pfl2=pfl+1
  987.         pfl3=pfl+2
  988.         pfline=pen3||RIGHT(pfl,3)||def LEFT(WORD(pros,pfl),21)
  989.         IF pfl2<=totpros THEN
  990.           pfline=pfline pen3||RIGHT(pfl2,3)||def LEFT(WORD(pros,pfl2),21)
  991.         IF pfl3<=totpros THEN
  992.           pfline=pfline pen3||RIGHT(pfl3,3)||def LEFT(WORD(pros,pfl3),21)
  993.         SAY pfline
  994.         IF nonstop~=1 & ((pfl3%3)//linesperpage)=0 THEN
  995.           IF waiting(2) THEN LEAVE pfl1
  996.       END
  997.       emnum=getinput(1 0 pen3'Select User Profile Number > 'def)
  998.       IF DATATYPE(emnum,'N') & emnum>0 & emnum<=totpros THEN
  999.         DO
  1000.           tmp=WORD(pros,emnum)
  1001.           IF level>sysoplevel THEN
  1002.             DO
  1003.               CALL bbsEd(1 prodir'/'tmp)
  1004.               IF readlines(prodir'/'tmp 1)~=0 THEN CALL DELETE(prodir'/'tmp)
  1005.               IF lynes.0<4 THEN CALL DELETE(prodir'/'tmp)
  1006.               pros=SHOWDIR(prodir)
  1007.             END
  1008.           ELSE CALL showtext(prodir'/'tmp)
  1009.         END
  1010.       ELSE LEAVE pf
  1011.     END
  1012.   ELSE IF temp=3 | temp=4 THEN
  1013.     DO
  1014.       searcharg=''
  1015.       nonstop=0
  1016.       IF temp=3 THEN
  1017.         DO
  1018.           searcharg=STRIP(getinput(0 0 'Enter Search Phrase > '))
  1019.           IF searcharg='' THEN ITERATE lupe
  1020.         END
  1021.       DO ui=1 TO WORDS(pros)
  1022.         pro=prodir'/'WORD(pros,ui)
  1023.         IF temp=3 THEN
  1024.           IF textsearch(pro searcharg)=0 THEN ITERATE ui
  1025.         SAY
  1026.         CALL readlines(pro 1)
  1027.         IF nonstop=1 THEN rnonstop=1
  1028.         ELSE rnonstop=0
  1029.         CALL seelines(2)
  1030.         IF rnonstop THEN nonstop=1
  1031.         ELSE IF waiting2()=1 THEN LEAVE ui
  1032.         SAY
  1033.         SAY
  1034.       END
  1035.     END
  1036.   ELSE IF temp='' | temp='Q' THEN LEAVE lupe
  1037. END
  1038. DROP pros
  1039. RETURN
  1040.  
  1041.  
  1042. otheruser:
  1043. line=''
  1044. IF level>sysoplevel THEN line='['pen3'R'def']eport or'
  1045. line=line 'simple ['pen3'N'def']amelist or ['pen3'D'def']etails?'
  1046. IF level>sysoplevel THEN line=line '(nDr) > '
  1047. ELSE line=line '(Dn) > '
  1048. temp=getinput(1 1 line)
  1049. IF temp='N' THEN
  1050.   DO
  1051.     CALL showuserlist()
  1052.     RETURN
  1053.   END
  1054. ELSE IF level>sysoplevel & temp='R' THEN
  1055.   DO
  1056.     SAY
  1057.     line=''
  1058.     IF getinput(1 1 'Report on inactive users? (nY) > ')~='N' THEN
  1059.       DO
  1060.         CALL cleanline(0)
  1061.         SAY 'INACTIVE_USERS report will be in your email.'
  1062.         line='USERS '
  1063.       END
  1064.     IF getinput(1 1 'Report on actual files vs. filelists? (nY) > ')~='N' THEN
  1065.       DO
  1066.         CALL cleanline(0)
  1067.         line=line'FILES'
  1068.         line=STRIP(line getinput(1 0 'Report only files larger than (0) bytes > '))
  1069.         SAY 'FILELISTS_REPORT will be in your email.'
  1070.       END
  1071.     SAY
  1072.     ADDRESS AREXX bbsREPORT.rexx name line 
  1073.     RETURN
  1074.   END
  1075. SAY
  1076. SAY 'To allow (or not) other users to see your street address and/or phone number,'
  1077. SAY 'add (or delete) STREET and/or PHONE to the line 8 list in ['pen3'Y'def']our userfile.'
  1078. SAY
  1079. SAY 'User specification may include ? wildcard for single characters.'
  1080. SAY 'ie,' pen3's?n'def 'will return all user names containing ''son'', ''sen'', ''sin'', etc.'
  1081. IF arg='' THEN arg=getinput(1 0 pen3'User specification: 'def)
  1082. IF arg='' THEN RETURN
  1083. arg=TRANSLATE(STRIP(arg),'_',' ')
  1084. CALL FileList(bbspath'Users/*'arg'*',wildlist)
  1085. line='Found' wildlist.0 'match'
  1086. IF wildlist.0~=1 THEN line=line'es'
  1087. SAY line'.'
  1088. IF wildlist.0<1 THEN RETURN
  1089. totlines=0
  1090. nextpagebreak=linesperpage-3
  1091. extrainfo=0
  1092. IF level>sysoplevel THEN
  1093.   DO
  1094.     IF getinput(1 1 'Display -sysop only- information? (nY) > ')~='N' THEN
  1095.       extrainfo=1
  1096.   END
  1097. DO i=1 TO wildlist.0
  1098.   CALL readlines(wildlist.i 1)
  1099.   SAY 
  1100.   totlines=totlines+6
  1101.   SAY bak2' 'SUBSTR(wildlist.i,LASTPOS('/',wildlist.i)+1)' 'def
  1102.   SAY lynes.1
  1103.   IF FIND(UPPER(lynes.8),'STREET')>0 THEN
  1104.     DO
  1105.       totlines=totlines+1
  1106.       SAY lynes.2
  1107.     END
  1108.   SAY lynes.3
  1109.   IF FIND(UPPER(lynes.8),'PHONE')>0 THEN
  1110.     DO
  1111.       totlines=totlines+1
  1112.       SAY lynes.4
  1113.     END
  1114.   SAY 'Last time on' bbsname':' DATE(,WORD(lynes.13,1),'S') WORD(lynes.13,2)
  1115.   SAY pen3'Interests:'def lynes.10
  1116.   IF extrainfo THEN
  1117.     DO
  1118.       SAY pen3'   up:'def lynes.14
  1119.       SAY pen3' down:'def lynes.15
  1120.       temptot=0
  1121.       DO j=1 TO WORDS(lynes.23)
  1122.         IF DATATYPE(WORD(lynes.23,j),'N') THEN temptot=temptot+WORD(lynes.23,j)
  1123.       END
  1124.       SAY pen3' writ:'def temptot 'public messages.'
  1125.       SAY pen3'level:'def lynes.20
  1126.       totlines=totlines+4
  1127.       IF lynes.21~='' THEN
  1128.         DO
  1129.           totlines=totlines+1
  1130.           SAY pen3'excluded dirs:'def lynes.21
  1131.         END
  1132.     END
  1133.   IF nonstop~=1 & totlines>=nextpagebreak THEN
  1134.     DO
  1135.       IF waiting2() THEN LEAVE i
  1136.       nextpagebreak=totlines+linesperpage-5
  1137.     END
  1138. END
  1139. nonstop=0
  1140. DROP wildlist.
  1141. IF waitchar~='Q' THEN CALL waiting()
  1142. RETURN
  1143.  
  1144.  
  1145. changename:
  1146. ARG cname
  1147. IF level<=sysoplevel THEN RETURN
  1148. IF cname='' THEN cname=getinput(1 0 'Current Username (include underscore): ')
  1149. IF readlines(bbspath'Users/'cname 1)>0 THEN RETURN
  1150. IF WORD(lynes,20)>=level THEN RETURN
  1151. CALL SETCLIP('BBS_oldname',cname)
  1152. CALL ChangeUserName.rexx()
  1153. cname=GETCLIP('BBS_newname')
  1154. CALL DELETE(bbspath'Lists/USERS')
  1155. sortuserflag=1
  1156. CALL SETCLIP('BBS_oldname')
  1157. CALL SETCLIP('BBS_newname')
  1158. RETURN cname
  1159.  
  1160.  
  1161. levelreport:
  1162. minlev=0
  1163. maxlev=99
  1164. templist=''
  1165. newufile=bbspath'Lists/NEW_USERS'
  1166. IF EXISTS(newufile) THEN
  1167.   DO
  1168.     IF getinput(1 1 'Latest New Users Only? (nY) > ')~='N' THEN
  1169.       DO
  1170.         IF readlines(newufile 1)=0 THEN
  1171.           DO i=2 TO lynes.0
  1172.             templist=STRIP(templist WORD(lynes.i,5))
  1173.           END
  1174.       END
  1175.     ELSE newufile=''
  1176.   END
  1177. ELSE newufile=''
  1178. IF newufile='' THEN
  1179.   DO
  1180.     minlev=getinput(1 0 'Minimum level? (0) > ')
  1181.     maxlev=getinput(1 0 'Maximum level? (99) > ')
  1182.     IF ~DATATYPE(minlev,'N') THEN minlev=0
  1183.     IF ~DATATYPE(maxlev,'N') THEN maxlev=99
  1184.     IF minlev<0 | minlev>99 THEN minlev=0
  1185.     IF maxlev<0 | maxlev>99 THEN maxlev=99
  1186.     templist=userlist
  1187.   END
  1188. DO levi=1 TO WORDS(templist)
  1189.   arg=bbspath'Users/'WORD(templist,levi)
  1190.   CALL readlines(arg 1)
  1191.   IF lynes.20<minlev | lynes.20>maxlev THEN ITERATE levi
  1192.   line=lynes.20 WORD(templist,levi)
  1193.   SAY line
  1194.   IF ~DATATYPE(WORD(lynes.20,1),'N') | WORD(lynes.20,1)<10 THEN
  1195.     DO
  1196.       SAY line
  1197.       DO levj=1 TO 12
  1198.         SAY pen3'  'lynes.levj||def
  1199.       END
  1200.       SAY pen3'  'lynes.19||def
  1201.       lcom=getinput(1 1 '['pen3'A'def']dd or ['pen3'K'def']ill or ['pen3'R'def']ename or ['pen3'S'def']kip this user? (Akrs) > ')
  1202.       CALL cleanline(0)
  1203.       IF lcom='K' THEN
  1204.         DO
  1205.           arg=WORD(templist,levi)
  1206.           CALL killuser()
  1207.         END
  1208.       ELSE IF lcom='R' THEN
  1209.         DO
  1210.           newname=changename(WORD(templist,levi))
  1211.           IF newname~='' & newname~=WORD(templist,levi) THEN
  1212.             DO
  1213.               temp=WORDINDEX(templist,levi+1)
  1214.               rtemp=''
  1215.               IF temp>0 THEN rtemp=SUBSTR(templist,temp)
  1216.               temp=WORDINDEX(templist,levi)
  1217.               templist=''
  1218.               IF temp>1 THEN templist=STRIP(LEFT(templist,temp-1))
  1219.               templist=STRIP(templist newname rtemp)
  1220.               userlist=userlist newname
  1221.             END
  1222.           levi=levi-1
  1223.           CALL SETCLIP('BBS_newname')
  1224.         END
  1225.       ELSE IF lcom~='S' THEN
  1226.         DO
  1227.           IF readopen(bbspath'BBS_TEXT/DEF.MEMBER') THEN
  1228.             DO
  1229.               DO lvi=1 TO 21
  1230.                 line=READLN(f)
  1231.                 IF lvi=11 THEN lynes.11=line
  1232.                 IF lvi=20 THEN lynes.20=line
  1233.               END
  1234.               lynes.21=line
  1235.               CALL CLOSE(f)
  1236.               edtype=''
  1237.               CALL savelines(arg)
  1238.               SAY lynes.20 WORD(templist,levi) 'has been made a member.'
  1239.             END
  1240.           ELSE SAY 'You need a default member file in BBS_TEXT!  ( BBS_TEXT/DEF.MEMBER )'
  1241.         END
  1242.       IF lcom~='K' & lcom~='R' THEN
  1243.         DO
  1244.           arg=WORD(templist,levi)
  1245.           IF getinput(1 1 'Write' arg 'an email message? (nY) > ')~='N' THEN
  1246.             DO
  1247.               IF EXISTS(bbspath'BBS_TEXT/EMAIL_WELCOME') THEN
  1248.                 IF getinput(1 1 'Use default welcome? (nY) > ')~='N' THEN
  1249.                   replysubj='|@NEW@|'
  1250.               CALL editor('MAIL' arg)
  1251.             END
  1252.        END
  1253.     END
  1254. END
  1255. IF newufile~='' THEN CALL DELETE(newufile)
  1256. DROP templist
  1257. RETURN
  1258.  
  1259.  
  1260. filereport:
  1261. SAY 'Searching for mismatches between files and filenotes...'
  1262. DO i=1 TO sysoplevel+1
  1263.   IF dirs.i='' THEN ITERATE
  1264.   SAY dirs.i'                               'lineup
  1265.   rfiles=SHOWDIR(libpath||dirs.i)
  1266.   rnotes=SHOWDIR(bbspath'FileNotes/'dirs.i)
  1267.   IF WORDS(rfiles)~=WORDS(rnotes) THEN
  1268.     DO
  1269.       line='Compare files & filenotes in'pen3 dirs.i||def'. '
  1270.       DO j=1 TO WORDS(rfiles)
  1271.         IF FIND(UPPER(rnotes),UPPER(WORD(rfiles,j)))=0 THEN
  1272.           line=line WORD(rfiles,j)
  1273.       END
  1274.       SAY line
  1275.     END
  1276. END
  1277. SAY '07'x
  1278. CALL waiting()
  1279. RETURN
  1280.  
  1281.  
  1282. mailreport:
  1283. SAY 'Checking ALL pending Email...'
  1284. SAY pen3' - Use CTRL-E to Exit -'def
  1285. SAY
  1286. mailrep=SHOWDIR(bbspath'Email','D')
  1287. mailfil=SHOWDIR(bbspath'EmailFiles','D')
  1288. lastemail=WORD(data.17,3)
  1289. IF ~DATATYPE(lastemail,'N') THEN lastemail=0
  1290. IF lastemail=countcheck(bbspath'Numbers/LastMail' 0) THEN
  1291.   DO
  1292.     DROP mailrep. mailfil.
  1293.     RETURN
  1294.   END
  1295. mailynes.=''
  1296. mk=0
  1297. DO mi=1 TO WORDS(mailrep)
  1298.   muser=WORD(mailrep,mi)
  1299.   IF muser=sysop | muser=name THEN ITERATE mi
  1300.   mlist=SHOWDIR(bbspath'Email/'muser)
  1301.   IF WORDS(mlist)>0 THEN SAY lineup||RIGHT(muser,40)
  1302.   DO mj=1 TO WORDS(mlist)
  1303.     fuser=WORD(mlist,mj)
  1304.     IF POS(sysop,fuser)>0 THEN ITERATE mj
  1305.     IF logonflag=0 THEN
  1306.       DO
  1307.         mk=mk+1
  1308.         mailynes.mk=pen3||LEFT(muser,20) 'from'def LEFT(fuser,20) DATE(,WORD(STATEF(bbspath'Email/'muser'/'fuser),5),'I')
  1309.       END
  1310.     IF POS(sysop,fuser)=0 & POS(name,fuser)=0 THEN
  1311.       DO
  1312.         testnum=RIGHT(fuser,LENGTH(fuser)-LASTPOS('.',fuser))
  1313.         IF testnum>emailnum THEN emailnum=testnum
  1314.         IF testnum>lastemail THEN
  1315.           DO
  1316.             CALL showtext(bbspath'Email/'muser'/'fuser)
  1317.             SAY
  1318.             SAY
  1319.           END
  1320.       END
  1321.   END
  1322.   IF logonflag=0 & FIND(mailfil,muser)>0 THEN
  1323.     DO
  1324.       efilelist=SHOWDIR(bbspath'EmailFiles/'muser)
  1325.       IF WORDS(efilelist)>0 THEN
  1326.         DO
  1327.           mk=mk+1
  1328.           mailynes.mk=pen3||LEFT(muser,20) 'emailfiles'def efilelist
  1329.         END
  1330.     END
  1331. END
  1332. data.17=WORD(data.17,1) WORD(data.17,2) countcheck(bbspath'Numbers/LastMail' 0)
  1333. IF mk>0 THEN
  1334.   DO
  1335.     lynes.0=mk
  1336.     DO mi=1 TO mk
  1337.       lynes.mi=mailynes.mi
  1338.     END
  1339.     CALL seelines(1)
  1340.     nonstop=0
  1341.     CALL waiting()
  1342.   END
  1343. ELSE SAY 'No unseen Email pending.'
  1344. DROP mailrep. mailfil. mailynes. mlist
  1345. RETURN
  1346.  
  1347.  
  1348. jump2rexx:
  1349. IF ~DATATYPE(jdoors.0,'N') THEN doors.0=0
  1350. IF WORDS(SHOWDIR(bbspath'rexxDoors','F'))~=doors.0 THEN
  1351.   DO
  1352.     jdoors.=''
  1353.     doorlist=SHOWDIR(bbspath'rexxDoors','F')
  1354.     doors.=''
  1355.     doors.0=WORDS(doorlist)
  1356.     DO i=1 TO doors.0
  1357.       doors.i=WORD(doorlist,i)
  1358.     END
  1359.     SAY 'Sorting..'lineup
  1360.     CALL QSORT(1,doors.0,doors)
  1361.     jdoors.0=doors.0%3
  1362.     IF (doors.0//3)>0 THEN jdoors.0=jdoors.0+1
  1363.     DO i=1 TO jdoors.0
  1364.       jdoors.i=LEFT(RIGHT(i,3)'.' LEFT(doors.i,LENGTH(doors.i)-5),24)
  1365.       DO j=1 TO 2
  1366.         k=i+j*jdoors.0
  1367.         IF k<=doors.0 THEN
  1368.           jdoors.i=jdoors.i' 'LEFT(RIGHT(k,3)'.' LEFT(doors.k,LENGTH(doors.k)-5),24)
  1369.       END
  1370.     END
  1371.   END
  1372. DO doorloop=1
  1373.   SAY pen3||LEFT('-',75,'-')||def
  1374.   DO jd=1 TO jdoors.0
  1375.     SAY jdoors.jd
  1376.     IF jd//linesperpage=0 THEN CALL waiting()
  1377.     IF waitchar='Q' THEN RETURN
  1378.   END
  1379.   temp=getinput(1 0 pen3'Select Application Number > 'def)
  1380.   IF ~DATATYPE(temp,'N') | temp<1 | temp>doors.0 THEN RETURN
  1381.   curdir=PRAGMA('D')
  1382.   CALL setdir(bbspath'rexxDoors')
  1383.   CALL SETCLIP('BBS_winnings')
  1384.   savewinnings=0
  1385.   INTERPRET 'call' doors.temp'('name winnings savewinnings colorflag')'
  1386.   testwin=GETCLIP('BBS_winnings')
  1387.   IF DATATYPE(testwin,'N') THEN
  1388.     DO
  1389.       IF testwin>7200 THEN
  1390.         DO
  1391.           SAY 'Although you won' TRUNC(testwin/60) 'minutes, the maximum session time is 120 minutes.'
  1392.           testwin=7200
  1393.         END
  1394.       winnings=testwin
  1395.       IF savewinnings>0 THEN
  1396.         DO
  1397.           maxtime=TRUNC(testwin+TIME('E'))
  1398.           winnings=savewinnings
  1399.         END
  1400.     END
  1401.   CALL setdir(curdir)
  1402.   CALL SETCLIP('BBS_winnings')
  1403. END
  1404. RETURN
  1405.  
  1406.  
  1407. sortlibraries:
  1408. SAY 'Sorting Libraries...'lineup
  1409. count=0
  1410. sdirs.=''
  1411. DO i=1 TO level
  1412.   IF dirs.i='' THEN ITERATE i
  1413.   count=count+1
  1414.   sdirs.count=dirs.i i
  1415. END
  1416. sdirs.0=count
  1417. CALL QSort(1,count,sdirs)
  1418. count=0
  1419. libs.=''
  1420. DO i=1 TO sdirs.0
  1421.   tempnum=WORD(sdirs.i,2)
  1422.   tempdir=WORD(sdirs.i,1)
  1423.   IF FIND(data.21,UPPER(tempdir))=0 THEN
  1424.     DO
  1425.       string=' '
  1426.       IF tempnum<10 THEN string=string' '
  1427.       string=string || tempnum'. 'LEFT(tempdir,14)
  1428.       count=count+1
  1429.       libs.count=string
  1430.     END
  1431. END
  1432. libs.0=count%4
  1433. IF (count//4)>0 THEN libs.0=libs.0+1
  1434. DO i=1 TO libs.0
  1435.   DO j=1 TO 3
  1436.     k=i+j*libs.0
  1437.     IF k<=count THEN libs.i=libs.i||libs.k
  1438.   END
  1439. END
  1440. DROP sdirs.
  1441. CALL sortconferences()
  1442. RETURN
  1443.  
  1444.  
  1445. sortconferences:
  1446. SAY 'Sorting Conferences...'lineup
  1447. count=0
  1448. smsg.=''
  1449. DO i=1 TO level
  1450.   IF msg.i='' THEN ITERATE i
  1451.   count=count+1
  1452.   smsg.count=msg.i i
  1453. END
  1454. smsg.0=count
  1455. CALL QSort(1,count,smsg)
  1456. count=0
  1457. msgs.=''
  1458. DO i=1 TO smsg.0
  1459.   tempnum=WORD(smsg.i,2)
  1460.   tempdir=WORD(smsg.i,1)
  1461.   IF FIND(data.21,tempnum)=0 THEN
  1462.     DO
  1463.       string=' '
  1464.       IF tempnum<10 THEN string=string' '
  1465.       string=string || tempnum'.'
  1466.       IF WORD(data.22,tempnum)='' | WORD(data.22,tempnum)>=0 THEN
  1467.         string=string LEFT(tempdir,20)
  1468.       ELSE string=string pen3'-OFF-'def LEFT(tempdir,14)
  1469.       count=count+1
  1470.       msgs.count=string
  1471.     END
  1472. END
  1473. msgs.0=count%3
  1474. IF (count//3)>0 THEN msgs.0=msgs.0+1
  1475. DO i=1 TO msgs.0
  1476.   DO j=1 TO 2
  1477.     k=i+j*msgs.0
  1478.     IF k<=count THEN msgs.i=msgs.i msgs.k
  1479.   END
  1480. END
  1481. DROP smsg.
  1482. RETURN
  1483.  
  1484.  
  1485. readmessages:
  1486. searcharg=''
  1487. DO FOREVER
  1488.   SAY 
  1489.   PARSE VAR arg temp' 'arg .
  1490.   IF DATATYPE(temp,'N') THEN msgdir=temp
  1491.   ELSE IF LEFT(UPPER(temp),1)='A' THEN
  1492.     DO
  1493.       CALL newmsgs()
  1494.       arg=''
  1495.       RETURN
  1496.     END
  1497.   ELSE IF LEFT(UPPER(temp),1)='M' THEN
  1498.     DO
  1499.       CALL readmarked()
  1500.       arg=''
  1501.       RETURN
  1502.     END
  1503.   ELSE
  1504.     DO
  1505.       SAY 'Select Message Conference By Number, ['pen3'M'def']arked only or ['pen3'A'def']ll Active'
  1506.       IF areaselect() THEN
  1507.         DO
  1508.           IF LEFT(temp,1)='A' THEN CALL newmsgs()
  1509.           IF LEFT(temp,1)='M' THEN CALL readmarked()
  1510.           RETURN
  1511.         END
  1512.     END
  1513.   pline='['pen3'A'def']rchive ['pen3'S'def']earch ['pen3'T'def']oggle ON/OFF'
  1514.   pline=pline '['pen3'R'def']ead ['pen3'Q'def']uit (aqRst) > '
  1515.   IF arg~='' THEN junk=UPPER(LEFT(arg,1))
  1516.   ELSE junk=getinput(1 1 pline)
  1517.   IF junk='Q' THEN RETURN
  1518.   IF junk='A' THEN
  1519.     DO
  1520.       SAY
  1521.       CALL msgcount(msgdir)
  1522.       junk=getinput(1 0 pen3'RETURN'def' to archive new msgs, ['pen3'Q'def']uit, or enter starting message number > ')
  1523.       IF junk='Q' THEN RETURN
  1524.       IF DATATYPE(junk,'N') THEN
  1525.         DO
  1526.           IF junk>lastmess | junk<1 THEN junk=1
  1527.           lastread.msgdir=junk-1
  1528.           CALL savedata(1)
  1529.         END
  1530.       CALL SETCLIP('BBS_MSGS','ON')
  1531.       SAY 'Archiving messages in the'pen3 msg.msgdir def'Conference...'
  1532.       lastread.msgdir=lastmess
  1533.       ADDRESS AREXX ArcMsgs.rexx name msgdir
  1534.       IF emailonline>=0 THEN emailonline=emailonline+1
  1535.       DO WHILE GETCLIP('BBS_MSGS')~=''
  1536.         CALL DELAY(14)
  1537.       END
  1538.       SAY 'When completed, the archive will be attached to email addressed to you.'
  1539.       CALL savedata(1)
  1540.       SAY
  1541.       RETURN
  1542.     END
  1543.   IF junk='S' THEN
  1544.     DO
  1545.       searcharg=''
  1546.       searcharg=getinput(0 0 pen3'Search Phrase: 'def)
  1547.       IF LENGTH(STRIP(searcharg))=0 THEN RETURN
  1548.       searcharg=COMPRESS(searcharg,'*')
  1549.       CALL searchmsgdir()
  1550.       searcharg=''
  1551.       RETURN
  1552.     END
  1553.   IF junk='T' THEN
  1554.     DO
  1555.       line='Turning the' msg.msgdir 'conference'
  1556.       IF WORD(data.22,msgdir)<0 THEN
  1557.         DO
  1558.           line=line pen3'ON'def'.'
  1559.           newdata='0'
  1560.         END
  1561.       ELSE
  1562.         DO
  1563.           line=line pen3'OFF'def'.'
  1564.           newdata='-1'
  1565.         END
  1566.       SAY line
  1567.       dataloc=WORDINDEX(data.22,msgdir)-1
  1568.       data.22=DELWORD(data.22,msgdir,1)
  1569.       IF dataloc>0 THEN data.22=INSERT(newdata' ',data.22,dataloc)
  1570.       CALL sortconferences()
  1571.     END
  1572.   CALL readmsg(0)
  1573.   CALL saveData(1)
  1574.   nonstop=0
  1575.   arg=''
  1576. END
  1577. RETURN
  1578.  
  1579.  
  1580. newmsgs:
  1581. test=UPPER(LEFT(arg,1))
  1582. IF test='' THEN
  1583.   test=getinput(1 1 '['pen3'R'def']ead new messages or ['pen3'A'def']rchive for later download. (aR) > ')
  1584. IF test='A' THEN
  1585.   DO
  1586.     CALL SETCLIP('BBS_MSGS','ON')
  1587.     SAY
  1588.     SAY 'Archiving new conference messages...'
  1589.     ADDRESS AREXX ArcMsgs.rexx name
  1590.     IF emailonline>=0 THEN emailonline=emailonline+1
  1591.     clear_marked=1
  1592.     DO i=1 TO level
  1593.       IF WORD(data.22,i)~=-1 THEN
  1594.         lastread.i=countcheck(bbspath'Numbers/LastMessage'i 0)
  1595.     END
  1596.     DO WHILE GETCLIP('BBS_MSGS')~=''
  1597.       CALL DELAY(14)
  1598.     END
  1599.     SAY 'When completed, the archive will be attached to email addressed to you.'
  1600.     CALL savedata(1)
  1601.     SAY
  1602.     RETURN
  1603.   END
  1604. curmsgdir=msgdir
  1605. SAY 'Scanning all Conferences for new messages..'
  1606. DO newi=1 TO level
  1607.   IF msg.newi='' THEN ITERATE newi
  1608.   msgdir=newi
  1609.   CALL readmsg(1)
  1610.   IF msgcom='Q' THEN LEAVE newi
  1611. END
  1612. CALL saveData(1)
  1613. msgdir=curmsgdir
  1614. nonstop=0
  1615. RETURN
  1616.  
  1617.  
  1618. readmsg:
  1619. ARG quietflag marknum .
  1620. msgcom=''
  1621. IF msg.msgdir='' | FIND(data.21,msgdir)>0 THEN RETURN; /* sysop excluded */
  1622. IF WORD(data.22,msgdir)=-1 THEN RETURN;                /*  user excluded */
  1623. entering='Entering'pen3 msg.msgdir def'Message Conference..'
  1624. IF quietflag=0 & marknum='' THEN SAY entering
  1625. IF DATATYPE(WORD(data.22,msgdir),'N') THEN
  1626.   lastread.msgdir=WORD(data.22,msgdir)
  1627. ELSE lastread.msgdir=0
  1628. lstwrt=countcheck(bbspath'Numbers/LastMessage'msgdir 0)
  1629. frstwrt=countcheck(bbspath'Numbers/FirstMessage'msgdir 0)
  1630. temp=''
  1631. IF marknum='' THEN
  1632.   DO
  1633.     IF lastread.msgdir>=lstwrt | lastread.msgdir<frstwrt THEN
  1634.       DO
  1635.         lastread.msgdir=lstwrt
  1636.         CALL msgcount(msgdir)
  1637.         IF quietflag=1 & lastread.msgdir=lstwrt THEN RETURN
  1638.         IF nonstop=1 THEN temp=''
  1639.         ELSE temp=getinput(1 0 pen3'Enter starting message number > 'def)
  1640.         IF temp='' THEN temp=lastread.msgdir
  1641.         IF ~DATATYPE(temp,'N') THEN RETURN
  1642.         IF temp<frstwrt THEN temp=frstwrt
  1643.         IF temp>lstwrt THEN temp=lstwrt
  1644.         IF temp<1 THEN temp=1
  1645.         lastread.msgdir=temp-1
  1646.       END
  1647.   END
  1648. ELSE lastread.msgdir=marknum-1
  1649. IF quietflag=1 THEN SAY entering
  1650. dirname=msgpath||msgdir
  1651. msglist.=0 /* set read to 0, unread to 1, and reply >=2 */
  1652. firstmess=999999
  1653. testlist=SHOWDIR(dirname)
  1654. DO i=1 TO WORDS(testlist)
  1655.   test=WORD(testlist,i)
  1656.   IF test>lastread.msgdir THEN msglist.test=1
  1657.   IF test<firstmess THEN firstmess=test
  1658. END
  1659. IF firstmess=999999 THEN firstmess=0
  1660. CALL countcheck(bbspath'Numbers/FirstMessage'msgdir firstmess)
  1661. msgstatus=1
  1662. IF temp='' & marknum='' THEN CALL msgcount(msgdir)
  1663. skipsubj.=''
  1664. skipsubj.0=0
  1665. DO msgloop=1
  1666.   lastreadnum=lastread.msgdir
  1667.   DO WHILE msglist.lastreadnum=0 & lastreadnum<lstwrt
  1668.     lastreadnum=lastreadnum+1
  1669.   END
  1670.   lastread.msgdir=lastreadnum
  1671.   IF lastreadnum=lstwrt & msglist.lstwrt=0 THEN LEAVE msgloop
  1672.   DO mess=lastread.msgdir TO lstwrt+1
  1673.     IF marknum~='' THEN
  1674.       DO
  1675.         IF mess>marknum THEN LEAVE msgloop
  1676.         mess=marknum
  1677.       END
  1678.     IF msglist.mess~=msgstatus THEN ITERATE mess
  1679.     IF msgstatus>1 THEN SAY 'Following the thread, level' msgstatus-1'.'
  1680.     msglist.mess=0
  1681.     arg=dirname'/'mess
  1682.     IF ~EXISTS(arg) THEN
  1683.       DO
  1684.         SAY 'Message number' mess 'is missing.'
  1685.         ITERATE mess
  1686.       END
  1687.     IF ~readopen(arg) THEN ITERATE mess
  1688.     firstline=READLN(f)
  1689.     secondline=READLN(f)
  1690.     thirdline=READLN(f)
  1691.     forthline=READLN(f)
  1692.     CALL CLOSE(f)
  1693.     CALL killmark(msgdir mess)
  1694.     DO skp=1 TO skipsubj.0
  1695.       IF forthline=skipsubj.skp THEN ITERATE mess
  1696.     END
  1697.     IF WORDS(firstline)>2 THEN /* if replies, change their num to >1 */
  1698.       DO
  1699.         thread=SUBSTR(firstline,WORDINDEX(firstline,4))
  1700.         DO tindx=1 TO WORDS(thread)
  1701.           test=WORD(thread,tindx)
  1702.           IF msglist.test~=0 THEN msglist.test=msgstatus+1
  1703.         END
  1704.       END
  1705.     savearg=arg
  1706.     msgcom='A'
  1707.     DO msgloop2=1 WHILE msgcom='A' | msgcom='O'
  1708.       CALL readlines(arg 1)
  1709.       IF nonstop=1 THEN rnonstop=1
  1710.       ELSE rnonstop=0
  1711.       CALL seelines(2)
  1712.       msgcom=''
  1713.       IF rnonstop THEN
  1714.         DO
  1715.           SAY
  1716.           nonstop=1
  1717.           msgcom=''
  1718.         END
  1719.       ELSE
  1720.         DO
  1721.           pline=''
  1722.           IF level<=sysoplevel | WORDS(lynes.3)<3 THEN pline='['pen3'A'def']gain '
  1723.           IF level>sysoplevel | name=WORD(lynes.2,2) THEN
  1724.             pline=pline'['pen3'E'def']dit ['pen3'K'def']ill'
  1725.           IF level>sysoplevel THEN pline=pline '['pen3'M'def']ove'
  1726.           IF WORDS(lynes.3)>3 THEN pline=pline '['pen3'O'def']riginal'
  1727.           pline=pline '['pen3'N'def']onStop ['pen3'R'def']eply'
  1728.           IF level=99 THEN pline=pline '['pen3'!'def']'
  1729.           pline=pline '['pen3'S'def']kip ['pen3'Q'def']uit ['pen3'?'def']'
  1730.           msgcom=getinput(1 0 pline' > ')
  1731.           CALL cleanline(0)
  1732.         END
  1733.       IF DATATYPE(msgcom,'N') & EXISTS(dirname'/'msgcom) THEN
  1734.         DO
  1735.           arg=dirname'/'msgcom
  1736.           IF msgcom>lastread.msgdir THEN lastread.msgdir=msgcom
  1737.           msgcom='A'
  1738.           ITERATE msgloop2
  1739.         END
  1740.       ELSE msgcom=LEFT(msgcom,1)
  1741.       IF msgcom='Q' THEN LEAVE msgloop
  1742.       ELSE IF msgcom='!' & level>sysoplevel THEN
  1743.         DO
  1744.           CALL DELETE(arg)
  1745.           newchar=LEFT(lynes.1,1)
  1746.           IF newchar~='!' THEN newchar='!!'
  1747.           ELSE newchar='  '
  1748.           lynes.1=OVERLAY(newchar,lynes.1,1,2)
  1749.           CALL savelines(arg)
  1750.           ITERATE msgloop2
  1751.         END
  1752.       ELSE IF msgcom='A' THEN ITERATE msgloop2
  1753.       ELSE IF msgcom='M' & level>sysoplevel THEN
  1754.         DO
  1755.           prevmsgdir=msgdir
  1756.           If areaselect()=0 THEN
  1757.             DO
  1758.               himsg=countcheck(bbspath'Numbers/LastMessage'msgdir 0)+1
  1759.               lynes.1='  Msg:' himsg
  1760.               lynes.3='   To:' WORD(lynes.3,2)
  1761.               lynes.5=STRIP(DELWORD(lynes.5,8,1)) msg.msgdir
  1762.               nlyn=lynes.0+1
  1763.               lynes.0=nlyn
  1764.               lynes.nlyn=' *** Moved from the' msg.prevmsgdir 'conference ***'
  1765.               CALL savelines(msgpath||msgdir'/'himsg)
  1766.               CALL countcheck(bbspath'Numbers/LastMessage'msgdir himsg)
  1767.               CALL msgmark(WORD(lynes.3,2) msgdir himsg)
  1768.               CALL readlines(arg 1)
  1769.               CALL DELETE(arg)
  1770.               CALL DELAY(28)
  1771.               lynes.0=7
  1772.               lynes.7='*** Moved to the' msg.msgdir 'conference, message #'himsg' ***'
  1773.               CALL savelines(arg)
  1774.             END
  1775.           msgdir=prevmsgdir
  1776.           msgcom='A'
  1777.         END
  1778.       ELSE IF msgcom='N' THEN
  1779.         DO
  1780.           nonstop=1
  1781.           msgcom=''
  1782.         END
  1783.       ELSE IF msgcom='H' | msgcom='?' THEN
  1784.         DO
  1785.           SAY pen3' - HELP with the Read Messages commands -'def
  1786.           SAY ' RETURN reads the next message in line.'
  1787.           SAY ' 34 will read message number 34, if it exists in this conference.'
  1788.           SAY ' A  reads this message Again (in case it scrolled off screen).'
  1789.           IF level>sysoplevel | name=WORD(lynes.2,2) THEN
  1790.             DO
  1791.           SAY ' E  puts this message into the online Editor.'
  1792.           SAY ' K  deletes a message you wrote. you cannot Kill others!'
  1793.             END
  1794.           IF level>sysoplevel THEN
  1795.           SAY ' M  move this message to a new conference.'
  1796.           SAY ' N  displays all new messages without pausing. CTRL-E to Exit!'
  1797.           SAY ' O  if this message is a reply, will read the Original message.'
  1798.           SAY ' R  enters the message editor to Reply to this message.'
  1799.           SAY ' S  allows you to Skip threads or conferences.'
  1800.         IF level=99 THEN
  1801.           SAY ' !  toggles the do-not-purge! flag for this message.'
  1802.           SAY ' Q  returns to the message menu. (Quit)'
  1803.           SAY
  1804.           CALL waiting()
  1805.           msgcom='A'
  1806.           IF waitchar='Q' THEN LEAVE msgloop
  1807.         END
  1808.       ELSE IF msgcom='E' THEN
  1809.         DO
  1810.           IF level>sysoplevel | name=WORD(lynes.2,2) THEN
  1811.             DO
  1812.               sline=7
  1813.               IF level>sysoplevel THEN sline=1
  1814.               CALL bbsED(sline arg)
  1815.               msgcom='A'
  1816.             END
  1817.         END
  1818.       ELSE IF msgcom='S' & mess<lstwrt THEN
  1819.         DO
  1820.           stemp=''
  1821.           DO WHILE stemp~='T' & stemp~='C'
  1822.             stemp=getinput(1 1 'Skip this ['pen3'T'def']hread or the entire ['pen3'C'def']onference (ct) > ')
  1823.           END
  1824.           IF stemp='T' THEN
  1825.             DO
  1826.               SAY
  1827.               SAY pen3 forthline||def
  1828.               SAY 'Skipping messages with this subject heading...'
  1829.               SAY
  1830.               DO i=lastread.msgdir TO lstwrt
  1831.                 IF msglist.i>1 THEN msglist.i=0
  1832.               END
  1833.               skipsubj.0=skipsubj.0+1
  1834.               sksb=skipsubj.0
  1835.               skipsubj.sksb=forthline
  1836.             END
  1837.           ELSE
  1838.             DO
  1839.               SAY pen3'Skipping to the last message in the'def msg.msgdir pen3'conference.'def
  1840.               lastread.msgdir=lstwrt-1
  1841.               lw=lstwrt-1
  1842.               msglist.lw=0
  1843.               msglist.lstwrt=1
  1844.               LEAVE mess
  1845.             END
  1846.         END
  1847.       ELSE IF msgcom='K' THEN
  1848.         DO
  1849.           IF level>sysoplevel | name=WORD(lynes.2,2) THEN
  1850.             DO
  1851.               IF getinput(1 1 'Really delete' arg'? (Ny) > ')='Y' THEN
  1852.                 DO
  1853.                   IF DELETE(arg)=1 THEN
  1854.                     SAY pen3||arg||def' has been deleted.'
  1855.                   grand=grand-1
  1856.                   msg.msgdir.0=msg.msgdir.0-1
  1857.                 END
  1858.             END
  1859.         END
  1860.       ELSE IF msgcom='O' THEN   /* go back and read original */
  1861.         DO
  1862.           IF WORDS(lynes.3)>3 THEN
  1863.             DO
  1864.               temp=WORD(lynes.3,4)
  1865.               arg=dirname'/'temp
  1866.             END
  1867.           ELSE SAY 'This is the original message.'
  1868.         END
  1869.       ELSE IF msgcom='R' THEN        /*  toname     msgnum  */
  1870.         DO
  1871.           msgnum=WORD(lynes.1,2)
  1872.           forthline=lynes.4
  1873.           IF editor('REPLY' WORD(lynes.2,2) msgnum) THEN /* reply */
  1874.             DO
  1875.               savearg2=arg
  1876.               arg=dirname'/'WORD(lynes.3,4)
  1877.               IF EXISTS(arg) THEN
  1878.                 DO
  1879.                   IF readlines(arg 1) THEN BREAK
  1880.                   xmsg=countcheck(bbspath'Numbers/LastMessage'msgdir mess)
  1881.                   IF WORDS(lynes.1)>3 THEN lynes.1=lynes.1 xmsg
  1882.                   ELSE lynes.1=lynes.1'   Reply' xmsg
  1883.                   CALL DELAY(28)    /* allow 1/2 sec for read to close */
  1884.                   CALL savelines(arg)
  1885.                 END
  1886.               arg=savearg2
  1887.             END
  1888.         END
  1889.       ELSE IF arg~=savearg THEN    /* Continue */
  1890.         DO
  1891.           msgcom='A'
  1892.           arg=savearg
  1893.         END
  1894.     END
  1895.     IF thread~='' THEN
  1896.       DO
  1897.         thread=''
  1898.         msgstatus=msgstatus+1
  1899.       END
  1900.   END
  1901.   IF msgstatus>1 THEN msgstatus=msgstatus-1
  1902. END
  1903. DROP msglist. skipsubj.
  1904. IF quietflag~=1 THEN nonstop=0
  1905. RETURN
  1906.  
  1907.  
  1908. showmarked:
  1909. IF WORDS(data.24)<1 THEN RETURN
  1910. SAY
  1911. SAY pen6'These unread conference messages have been ['pen3'M'pen6']arked as addressed to you:'def
  1912. tempkk=data.24
  1913. DO i=1 TO WORDS(tempkk)
  1914.   tempk=WORD(tempkk,i)
  1915.   PARSE VAR tempk kdir'/'kmsg
  1916.   IF EXISTS(msgpath||kdir'/'kmsg) THEN
  1917.     SAY RIGHT(kmsg,6) 'in the'pen3 msg.kdir def'conference.'
  1918.   ELSE data.24=DELWORD(data24,FIND(data.24,tempk))
  1919. END
  1920. CALL waiting()
  1921. SAY
  1922. RETURN
  1923.  
  1924.  
  1925. killmark:
  1926. PARSE ARG kdir kmsg .
  1927. IF data.24='' THEN RETURN
  1928. markword=FIND(data.24,kdir'/'kmsg)
  1929. IF markword>0 THEN data.24=STRIP(DELWORD(data.24,markword,1))
  1930. RETURN
  1931.  
  1932.  
  1933. readmarked:
  1934. mrknum=WORDS(data.24)
  1935. IF mrknum=0 THEN RETURN
  1936. SAY 'Reading only messages addressed to you...'
  1937. mrklist=data.24
  1938. msgcom=''
  1939. DO rmki=1 TO mrknum WHILE msgcom~='Q'
  1940.   tempk=WORD(mrklist,rmki)
  1941.   PARSE VAR tempk mkdir'/'mkmsg .
  1942.   IF ~EXISTS(msgpath||tempk) THEN
  1943.     DO
  1944.       CALL killmark(mkdir mkmsg)
  1945.       SAY
  1946.       SAY 'Message number' mkmsg 'in the' msg.mkdir 'conference is missing!'
  1947.       SAY
  1948.       ITERATE rmki
  1949.     END
  1950.   msgdir=mkdir
  1951.   savelast=lastread.msgdir
  1952.   CALL readmsg(1 mkmsg)
  1953.   IF mkmsg>savelast THEN lastread.msgdir=mkmsg
  1954.   ELSE lastread.msgdir=savelast
  1955. END
  1956. CALL saveData(1)
  1957. RETURN
  1958.  
  1959.  
  1960. sortnumbers:
  1961. PARSE ARG slist
  1962. IF STRIP(slist)='' THEN RETURN ''
  1963. sorted.=''
  1964. oldest=999999
  1965. newest=0
  1966. newlist=''
  1967. DO si=1 TO WORDS(slist)
  1968.   testword=WORD(slist,si)
  1969.   IF ~DATATYPE(testword,'N') THEN
  1970.     DO
  1971.       testpos=LASTPOS('.',testword)
  1972.       IF testpos>0 THEN tempnum=SUBSTR(testword,testpos+1)
  1973.       ELSE
  1974.         DO
  1975.           newlist=testword newlist
  1976.           ITERATE si
  1977.         END
  1978.     END
  1979.   ELSE tempnum=testword/1
  1980.   IF sorted.tempnum='' THEN
  1981.     DO
  1982.       sorted.tempnum=testword
  1983.       sorted.tempnum.0=1
  1984.       IF DATATYPE(tempnum,'N') THEN
  1985.         DO
  1986.           IF tempnum>newest THEN newest=tempnum
  1987.           IF tempnum<oldest THEN oldest=tempnum
  1988.         END
  1989.     END
  1990.   ELSE newlist=newlist testword
  1991. END
  1992. IF oldest~=999999 & newest~=0 THEN
  1993.   DO si=oldest TO newest
  1994.     IF sorted.si.0=1 THEN newlist=newlist sorted.si
  1995.   END
  1996. DROP sorted. oldest newest
  1997. RETURN STRIP(newlist)
  1998.  
  1999.  
  2000. readmail:
  2001. ARG fromenu .
  2002. replysubj=''
  2003. IF fromenu THEN
  2004.   DO
  2005.     temp=UPPER(arg)
  2006.     arg=''
  2007.     IF temp~='F' & temp~='T' & temp~='W' THEN
  2008.       DO
  2009.         line='Find Email ['pen3'F'def']rom You ['pen3'T'def']o You or ['pen3'W'def']rite New Email (ftw) > 'def
  2010.         temp=getinput(1 1 line)
  2011.         CALL cleanline(0)
  2012.       END
  2013.     IF temp='W' THEN
  2014.       DO
  2015.         CALL editor('MAIL')
  2016.         RETURN
  2017.       END
  2018.     ELSE IF temp='F' THEN
  2019.       DO
  2020.         SAY pen3'Scanning'def WORDS(userlist) pen3'email directories...'def
  2021.         firsteditline=0
  2022.         picklist.=''
  2023.         picklist.0=0
  2024.         DO ei=1 TO WORDS(userlist)
  2025.           fmaillist=SHOWDIR(bbspath'EMail/'WORD(userlist,ei))
  2026.           DO ej=1 TO WORDS(fmaillist)
  2027.             ejname=WORD(fmaillist,ej)
  2028.             uname=ejname
  2029.             caret=LASTPOS('.',uname)
  2030.             IF caret>2 THEN uname=LEFT(uname,caret-1)
  2031.             IF uname=name THEN
  2032.               DO
  2033.                 arg=bbspath'EMail/'WORD(userlist,ei)'/'ejname
  2034.                 IF EXISTS(arg) THEN
  2035.                   DO
  2036.                     pklst=picklist.0+1
  2037.                     picklist.pklst=WORD(userlist,ei)
  2038.                     picklist.pklst.0=ejname
  2039.                     picklist.0=pklst
  2040.                   END
  2041.               END
  2042.           END
  2043.         END
  2044.         IF picklist.0=0 THEN SAY lineup'No Email FROM you was found.                    '
  2045.         ELSE
  2046.           DO
  2047.             SAY pen3'You have Email pending to the following users:'def
  2048.             pickcheck=1
  2049.             DO WHILE pickcheck~=0
  2050.               pickcheck=pickfromlist()
  2051.               IF pickcheck~=0 THEN
  2052.                 DO
  2053.                   firsteditline=5
  2054.                   IF level>sysoplevel THEN firsteditline=1
  2055.                   CALL bbsED(firsteditline bbspath'Email/'picklist.pickcheck'/'picklist.pickcheck.0)
  2056.                   IF ~EXISTS(bbspath'Email/'picklist.pickcheck'/'picklist.pickcheck.0) THEN
  2057.                     picklist.pickcheck='- KILLED -'
  2058.                 END
  2059.             END
  2060.           END
  2061.         DROP picklist.
  2062.         RETURN
  2063.       END
  2064.     ELSE IF temp='T' THEN BREAK
  2065.     ELSE RETURN
  2066.   END
  2067. SAY 'Checking your mailbox..'
  2068. nomail=1
  2069. CALL MAKEDIR(bbspath'EMail/'name)
  2070. mailist=sortnumbers(SHOWDIR(bbspath'Email/'name))
  2071. IF WORDS(mailist)>0 THEN
  2072.   DO
  2073.     line=WORDS(mailist)
  2074.     IF line>1 THEN line=line 'letters'
  2075.     ELSE line=line 'letter'
  2076.     line=line 'waiting.'
  2077.     SAY line
  2078.     DO ii=1 TO WORDS(mailist)
  2079.       SAY 'Email:' pen3||WORD(mailist,ii)||def
  2080.     END
  2081.     IF ~fromenu THEN
  2082.       IF getinput(1 1 'Read your private mail now? (nY) > ')='N' THEN RETURN
  2083.   END
  2084. DO letter=1 TO WORDS(mailist)
  2085.   readname=WORD(mailist,letter)
  2086.   uname=readname
  2087.   caret=LASTPOS('.',uname)
  2088.   IF caret>2 THEN uname=LEFT(uname,caret-1)
  2089.   arg=bbspath'Email/'name'/'readname        /* user has mail! */
  2090.   CALL readlines(arg 1)
  2091.   CALL seelines(1)
  2092.   nomail=0
  2093.   nonstop=0
  2094.   mailfile=''
  2095.   IF UPPER(WORD(lynes.1,3))='FILE:' THEN mailfile=WORD(lynes.1,4)
  2096.   ELSE IF UPPER(WORD(lynes.2,3))='FILE:' THEN mailfile=WORD(lynes.2,4)
  2097.   IF mailfile~='' & readname~='NEW_FILES' & readname~='FILELISTS_REPORT' & readname~='INACTIVE_USERS' & LEFT(readname,3)~='MSG' THEN
  2098.     DO
  2099.       curdir=PRAGMA('D')
  2100.       CALL setdir(bbspath'EmailFiles/'name)
  2101.       ADDRESS COMMAND 'C:List >*' mailfile 'DATES'
  2102.       SAY ' Attached file:' pen3||mailfile||def
  2103.       junk=getinput(1 1 'Leave file in your EmailFiles? (Ny) > ')
  2104.       IF junk='Y' THEN mailfile=''
  2105.       ELSE
  2106.         DO
  2107.           junk=getinput(1 1 'Deleting Mail will also delete file. Copy somewhere now? (Ny) > ')
  2108.           IF junk='Y' THEN
  2109.             DO
  2110.               savearg=arg
  2111.               arg=mailfile
  2112.               CALL dload()
  2113.               arg=savearg
  2114.             END
  2115.             CALL setdir(curdir)
  2116.         END
  2117.     END
  2118.   IF readname~='NEW_FILES' & readname~='FILELISTS_REPORT' & readname~='INACTIVE_USERS' & LEFT(readname,3)~='MSG' & LEFT(readname,6)~='BBBBS.' THEN
  2119.     DO
  2120.       IF getinput(1 1 'Reply to this message? (nY) > ')~='N' THEN
  2121.         DO
  2122.           IF WORDS(lynes.4)<2 THEN replysubj='NONE'
  2123.           ELSE replysubj=SUBSTR(lynes.4,WORDINDEX(lynes.4,2))
  2124.           CALL editor('MAIL' uname)
  2125.           replysubj=''
  2126.         END
  2127.     END
  2128.   IF LEFT(readname,6)~='BBBBS.' THEN
  2129.     DO
  2130.       IF getinput(1 1 'Forward mail from'pen3 uname def'to other users? (Ny) > ')='Y' THEN
  2131.         DO
  2132.           IF selectchosen(1 pen3'Forward Email To: 'def)=0 THEN
  2133.             DO ei=1 TO thechosen.0 WHILE thechosen.ei~=''
  2134.               CALL MAKEDIR(bbspath'EMail/'thechosen.ei)
  2135.               forwardarg=bbspath'Email/'thechosen.ei'/'readname
  2136.               ADDRESS COMMAND 'C:COPY' bbspath'Email/'name'/'readname forwardarg
  2137.               CALL readlines(forwardarg 1)
  2138.               lynes.1=lynes.1'  Forwarded to you by' name TIME('C') DATE()
  2139.               CALL DELETE(forwardarg)
  2140.               CALL savelines(forwardarg)
  2141.               IF WORDS(lynes.2)>3 THEN
  2142.                 DO
  2143.                   forname=bbspath'EmailFiles/'name'/'WORD(lynes.2,4)
  2144.                   IF EXISTS(forname) THEN
  2145.                     DO
  2146.                       CALL MAKEDIR(bbspath'EmailFiles/'thechosen.ei)
  2147.                       ADDRESS COMMAND 'C:COPY' forname bbspath'EmailFiles/'thechosen.ei
  2148.                     END
  2149.                 END
  2150.               line='Mail' pen3||readname||def 'forwarded to' pen3||thechosen.ei||def
  2151.               IF emailonline>=0 THEN emailonline=emailonline+1
  2152.               SAY line
  2153.             END
  2154.         END
  2155.     END
  2156.   tempchar=getinput(1 1 'Delete the mail from'pen3 uname def'you just read? (nqY) > 'def)
  2157.   IF tempchar='Q' THEN
  2158.     IF getinput(1 1 'Quit reading your Email? (Ny) > ')='Y' THEN RETURN
  2159.   IF tempchar~='N' THEN
  2160.     DO
  2161.       dirname=bbspath'Email/'name'/'
  2162.       nodelete=0
  2163.       IF bbsprefs.14=1 & name~=sysop & uname~=sysop & WORD(lynes.2,2)~='BBBBS' & WORD(lynes.2,2)~=sysop & WORD(lynes.3,2)~=sysop THEN
  2164.         nodelete=1
  2165.       IF nodelete THEN
  2166.         ADDRESS COMMAND 'C:Copy' dirname||readname bbspath'Email/'sysop
  2167.       ELSE emailonline=emailonline-1
  2168.       CALL DELETE(dirname||readname)
  2169.       tempstr='Old email'
  2170.       IF mailfile~='' & readname~='NEW_FILES' & readname~='FILELISTS_REPORT' & readname~='INACTIVE_USERS' & EXISTS(bbspath'EmailFiles/'name'/'mailfile) THEN
  2171.         DO
  2172.           IF nodelete THEN
  2173.             ADDRESS COMMAND 'C:Copy' bbspath'EmailFiles/'name'/'mailfile bbspath'EmailFiles/'sysop
  2174.           CALL DELETE(bbspath'EmailFiles/'name'/'mailfile)
  2175.           tempstr=tempstr 'and attached file'
  2176.         END
  2177.       tempstr=tempstr 'deleted. Thank you for keeping a clean BBS!'
  2178.       SAY tempstr
  2179.       IF tempchar='Q' THEN
  2180.         IF getinput(1 1 'Quit reading your Email? (Ny) > ')='Y' THEN RETURN
  2181.     END
  2182.   ELSE IF LEFT(readname,3)='MSG' & level>sysoplevel THEN
  2183.     DO
  2184.       ii=LEFT(readname,POS('.',readname)-1)
  2185.       ii=SUBSTR(ii,4)%1
  2186.       IF getinput(1 1 'Move this message back to the' msg.ii 'conference? (nY) > 'def)~='N' THEN
  2187.         DO
  2188.           temp=TRANSLATE(readname,'/','.')
  2189.           temp=SUBSTR(temp,4)
  2190.           lynes.1='!!'STRIP(lynes.1)
  2191.           edtype=''
  2192.           CALL savelines(msgpath||temp)
  2193.           CALL DELETE(bbspath'Email/'name'/'readname)
  2194.         END
  2195.     END
  2196.   ELSE IF LEFT(readname,3)~='MSG' & readname~='NEW_FILES' & readname~='FILELISTS_REPORT' & readname~='INACTIVE_USERS' THEN
  2197.     DO
  2198.       arg=bbspath'Email/'name'/'readname
  2199.       CALL readlines(arg 1)
  2200.       IF WORDS(lynes.5)<7 THEN
  2201.         DO
  2202.           lynes.5=lynes.5'  (Rcvd)' DATE('W') DATE() TIME('C')
  2203.           CALL DELETE(arg)
  2204.           CALL savelines(arg)
  2205.           SAY 'Email has been marked as received.'
  2206.         END
  2207.     END
  2208.   readname=''
  2209.   uname=''
  2210.   arg=''
  2211. END
  2212. IF nomail THEN
  2213.   DO
  2214.     SAY 'No mail was found.'
  2215.     CALL waiting()
  2216.   END
  2217. CALL setdir(libpath||dirs.1)
  2218. thechosen.=''
  2219. RETURN
  2220.  
  2221.  
  2222. selectchosen:
  2223. PARSE ARG startat selectline
  2224. IF startat<2 THEN thechosen.=''
  2225. line='Enter list of comma separated user names'
  2226. IF level>sysoplevel THEN line=line 'or ALL'
  2227. SAY line
  2228. thechosen.startat=getinput(1 0 selectline' ')
  2229. IF STRIP(thechosen.startat)='' THEN RETURN 1
  2230. thechosen.startat=SPACE(thechosen.startat,1,'_')
  2231. thechosen.0=startat
  2232. IF level>sysoplevel & thechosen.startat='ALL' THEN
  2233.   thechosen.startat=SHOWDIR(bbspath'Users','F',',')
  2234. IF POS(',',thechosen.startat)>0 THEN
  2235.   DO
  2236.     temp=TRANSLATE(thechosen.startat,' ',',')
  2237.     thechosen.0=thechosen.0+WORDS(temp)-1
  2238.     DO ei=1 TO WORDS(temp)
  2239.       eii=startat+ei-1
  2240.       thechosen.eii=STRIP(WORD(temp,ei))
  2241.     END
  2242.   END
  2243. DO ei=startat TO thechosen.0
  2244.   DO WHILE FIND(userlist,thechosen.ei)=0
  2245.     IF thechosen.ei~='' THEN
  2246.       DO
  2247.         IF FIND(exclusion,thechosen.ei)>0 | thechosen.ei='BBBBS' THEN
  2248.           DO
  2249.             thechosen.ei=sysop
  2250.             ITERATE ei
  2251.           END
  2252.         CALL loadcourtesy()
  2253.         IF FIND(courtesy,thechosen.ei)>0 THEN ITERATE ei
  2254.       END
  2255.     SAY thechosen.ei 'not found! Enter that name again or press RETURN.'
  2256.     thechosen.ei=getinput(1 0 pen3||selectline' 'def)
  2257.     IF thechosen.ei='' THEN
  2258.       DO
  2259.         IF getinput(1 1 'Do you want to see the list of current users? (Ny) > ')='Y' THEN
  2260.           CALL showuserlist()
  2261.         ITERATE ei
  2262.       END
  2263.     thechosen.ei=SPACE(thechosen.ei,1,'_')
  2264.   END
  2265. END
  2266. RETURN 0
  2267.  
  2268.  
  2269. countcheck:
  2270. PARSE ARG fname' 'cknum' '.
  2271. IF ~EXISTS(fname) THEN
  2272.   DO
  2273.     IF cknum=0 THEN RETURN 0
  2274.     IF ~writeopen(fname) THEN RETURN 0
  2275.     CALL WRITELN(f,cknum)
  2276.     CALL CLOSE(f)
  2277.     RETURN cknum
  2278.   END
  2279. IF ~readopen(fname) THEN RETURN cknum
  2280. retval=STRIP(READLN(f))
  2281. CALL CLOSE(f)
  2282. IF ~DATATYPE(retval,'N') THEN retval=0
  2283. IF ~DATATYPE(cknum,'N') THEN cknum=0
  2284. IF retval<cknum THEN
  2285.   DO
  2286.     IF writeopen(fname) THEN
  2287.       DO
  2288.         CALL WRITELN(f,cknum)
  2289.         CALL CLOSE(f)
  2290.         RETURN cknum
  2291.       END
  2292.   END
  2293. RETURN retval
  2294.  
  2295.  
  2296. pickfromlist:
  2297. DO pfl=1 TO picklist.0 BY 3
  2298.   pfl2=pfl+1
  2299.   pfl3=pfl+2
  2300.   pfline=pen3||RIGHT(pfl,3)||def LEFT(picklist.pfl,21)
  2301.   IF picklist.pfl2~='' THEN
  2302.     pfline=pfline pen3||RIGHT(pfl2,3)||def LEFT(picklist.pfl2,21)
  2303.   IF picklist.pfl3~='' THEN
  2304.     pfline=pfline pen3||RIGHT(pfl3,3)||def LEFT(picklist.pfl3,21)
  2305.   SAY pfline
  2306. END
  2307. emnum=getinput(1 0 pen3'Select Email Number > 'def)
  2308. IF ~DATATYPE(emnum,'N') | emnum<1 | emnum>picklist.0 THEN RETURN 0
  2309. RETURN emnum
  2310.  
  2311.  
  2312. sysED:
  2313. IF level<99 THEN RETURN
  2314. arg=getinput(0 0 'Textfile To Edit: ')
  2315. IF arg='' THEN RETURN
  2316. CALL bbsED(1 arg)
  2317. RETURN
  2318.  
  2319.  
  2320. bbsED:
  2321. PARSE ARG firstedit editarg .
  2322. notchanged=1
  2323. IF readlines(editarg 1) THEN RETURN 1
  2324. finfo=STATEF(editarg)
  2325. IF WORDS(finfo)>7 THEN finfo=SUBSTR(finfo,WORDINDEX(finfo,8))
  2326. ELSE finfo=''
  2327. SAY 
  2328. SAY '                   'pen3'Entering the EDITOR module..'def
  2329. SAY 
  2330. count=1
  2331. DO edloop=1
  2332.   IF edcom='S' & bbsprefs.5 THEN  /* spell check */
  2333.     DO
  2334.       SAY pen3'You must use ['def'R'pen3']eplace to make corrections.  'pen2'Spellchecking...'def
  2335.       CALL DELETE(scratch'/SpellLOCAL')
  2336.       CALL savelines(scratch'/SpellLOCAL')
  2337.       curdir=PRAGMA('D')
  2338.       CALL setdir(spellpath)
  2339.       CALL SpellChk.rexx(scratch'/SpellLOCAL')
  2340.       CALL setdir(curdir)
  2341.     END
  2342.   ELSE
  2343.     DO
  2344.       IF edcom='R' | edcom='I' | edcom='L' THEN CALL wrapbuf(7)
  2345.       IF edcom~='L' THEN count=count-linesperpage
  2346.       IF count>=lynes.0 | count<1 THEN count=1
  2347.       startcount=count
  2348.       DO i=startcount TO lynes.0+1
  2349.         IF ((i+1-startcount)//linesperpage)=0 THEN
  2350.           DO
  2351.             pline='                 ['pen3'E'def']dit'
  2352.             pline=pline '  ['pen3'RETURN'def']=Continue '
  2353.             edcom=getinput(1 1 pline)
  2354.             IF edcom~='' THEN LEAVE i
  2355.             CALL cleanline(1)
  2356.           END
  2357.         SAY pen3||RIGHT(i,2)||def lynes.i
  2358.         count=count+1
  2359.       END
  2360.     END
  2361.   SAY lineup'     ['pen3'A'def']ppend ['pen3'C'def']ut     ['pen3'I'def']nsert  ['pen3'K'def']ill       ['pen3'?'def'] Help'
  2362.   pline='     ['pen3'L'def']ist   ['pen3'P'def']aste   ['pen3'R'def']eplace'
  2363.   pline=pline '['pen3'S'def']pellcheck'
  2364.   pline=pline '['pen3'U'def']pload-Text > '
  2365.   edcom=getinput(1 0 pline)
  2366.   IF edcom='Q' | edcom='X' THEN edcom=''
  2367.   IF edcom='?' THEN
  2368.     DO
  2369.       SAY
  2370.       SAY '                   Editor Help'
  2371.       SAY '-------------------------------------------------------'
  2372.       SAY ' 7  edits line number 7, if it exists.'
  2373.       SAY ' a  Append text to this file.'
  2374.       SAY ' c  Cut selected line(s) of text to buffer.'
  2375.       SAY ' i  Insert blank line.'
  2376.       SAY ' k  Kill (delete) this file.'
  2377.       SAY ' l  List this file from selected line.'
  2378.       SAY ' p  Paste buffer contents to selected line number.'
  2379.       SAY ' r  Replace a phrase or line of text.'
  2380.       SAY ' s  Spellcheck this file.'
  2381.       SAY ' u  Upload a textfile to append to this file.'
  2382.       SAY '    An empty RETURN indicates you are finished editing.'
  2383.       SAY '-------------------------------------------------------'
  2384.       SAY
  2385.       OPTIONS PROMPT ''
  2386.       PULL
  2387.     END
  2388.   IF edcom='K' THEN
  2389.     DO
  2390.       junk=getinput(1 1 'Are you' pen3'sure'def 'you want to delete' editarg'? (Ny) > ')
  2391.       IF junk='Y' THEN
  2392.         DO
  2393.           IF DELETE(editarg)=1 THEN SAY editarg 'DELETED.'
  2394.           IF WORD(lynes.1,1)='Mail:' & WORDS(lynes.2)>3 THEN
  2395.             DO
  2396.               IF DELETE(bbspath'EmailFiles/'WORD(lynes.3,2)'/'WORD(lynes.2,4))=1 THEN
  2397.                 SAY WORD(lynes.2,4) 'DELETED.'
  2398.             END
  2399.           RETURN 2
  2400.         END
  2401.     END
  2402.   IF edcom='' THEN
  2403.     DO
  2404.       SAY '                   'pen3'Leaving the EDITOR module.'def
  2405.       IF notchanged THEN RETURN 0
  2406.       IF getinput(1 1 '                     Save changes? (nY)'pen3' > 'def)='N' THEN
  2407.         RETURN 1
  2408.       CALL DELETE(editarg)
  2409.       IF savelines(editarg) THEN RETURN 1
  2410.       CALL DELAY(28)
  2411.       IF finfo~='' THEN ADDRESS COMMAND 'C:filenote' editarg finfo
  2412.       SAY pen3'                        Changes saved.'def
  2413.       RETURN 0
  2414.     END
  2415.   ELSE IF edcom='C' THEN  /* Cut */
  2416.     DO
  2417.       firstnum=getinput(1 0 '   Enter line number or range 'pen3'(5-7)'def' to cut' pen3'>'def)
  2418.       IF firstnum='' THEN ITERATE edloop
  2419.       dash=POS('-',firstnum)
  2420.       IF dash>0 THEN
  2421.         DO
  2422.           lastnum=STRIP(SUBSTR(firstnum,dash+1))
  2423.           firstnum=STRIP(LEFT(firstnum,dash-1))
  2424.         END
  2425.       ELSE lastnum=firstnum
  2426.       IF ~DATATYPE(firstnum,'N') | ~DATATYPE(lastnum,'N') THEN
  2427.         DO
  2428.           junk=getinput(1 1 pen3'*** You must enter numbers here! 'def)
  2429.           ITERATE edloop
  2430.         END
  2431.       IF lastnum>lynes.0 THEN lastnum=lynes.0
  2432.       IF firstnum<firstedit THEN
  2433.         DO
  2434.           SAY '*** You are not authorized to delete that line!'
  2435.           SAY
  2436.           ITERATE edloop
  2437.         END
  2438.       IF firstnum>lastnum THEN
  2439.         DO
  2440.           SAY '*** Input error!  First number larger than last number'
  2441.           ITERATE edloop
  2442.         END
  2443.       notchanged=0
  2444.       numdiff=lastnum+1-firstnum
  2445.       pasted.=''
  2446.       pasted.0=numdiff
  2447.       k=0
  2448.       DO i=firstnum TO lynes.0
  2449.         j=i+numdiff
  2450.         k=k+1
  2451.         IF k<=numdiff THEN pasted.k=lynes.i
  2452.         lynes.i=lynes.j
  2453.         lynes.j=''
  2454.       END
  2455.       lynes.0=lynes.0-numdiff
  2456.       count=1
  2457.     END
  2458.   ELSE IF edcom='A' THEN  /* append */
  2459.     DO
  2460.       CALL writebuffer(scratch'/EditorLOCAL')
  2461.       notchanged=0
  2462.     END
  2463.   ELSE IF edcom='U' THEN  /* fileappend (upload) */
  2464.     DO
  2465.       frompath=GETCLIP('BBS_frompath')
  2466.       IF frompath='' THEN frompath=libpath'SysOps'
  2467.       farg=GetFile(150,36,frompath,'',' Select TextFile to Append ')
  2468.       IF farg~='' & EXISTS(farg) THEN
  2469.         DO
  2470.           CALL readlines(farg lynes.0+1)
  2471.           notchanged=0
  2472.           CALL SETCLIP('BBS_frompath',WORD(lastslash(farg),2))
  2473.         END
  2474.     END
  2475.   ELSE IF edcom='I' | edcom='R' | edcom='L' | edcom='P' | DATATYPE(edcom,'N') THEN
  2476.     DO
  2477.       IF DATATYPE(edcom,'N') THEN
  2478.         DO
  2479.           ednum=edcom
  2480.           edcom='R'
  2481.         END
  2482.       ELSE
  2483.         DO
  2484.           line=pen3'   '
  2485.           IF edcom='L' | edcom='P' THEN line=line'Starting '
  2486.           line=line'Line Number? > 'def
  2487.           ednum=getinput(1 0 line)
  2488.         END
  2489.       IF ~DATATYPE(ednum,'N') THEN ITERATE edloop
  2490.       IF ednum>(lynes.0+1) THEN ITERATE edloop
  2491.       IF edcom='L' THEN
  2492.         DO
  2493.           count=ednum
  2494.           ITERATE edloop
  2495.         END
  2496.       IF ednum=1 & UPPER(WORD(lynes.1,1))='FILE:' THEN
  2497.         DO
  2498.           IF getinput(1 1 pen3'Edit KeyWords:? (Ny) > 'def)='Y' THEN
  2499.             DO
  2500.               filenum=STRIP(WORD(lynes.1,2))
  2501.               num=files.filenum.0
  2502.               keywords=edkeywords(editarg)
  2503.               lynes.1=LEFT(lynes.1,21) keywords
  2504.               alpha.num=TRIM(OVERLAY(keywords,alpha.num,47,32))
  2505.               savefileflag=1
  2506.               notchanged=0
  2507.               ITERATE edloop
  2508.             END
  2509.         END
  2510.       IF ednum<firstedit THEN
  2511.         DO
  2512.           SAY '*** You are not authorized to alter that line!'
  2513.           SAY
  2514.           ITERATE edloop
  2515.         END
  2516.       IF edcom='R' THEN   /* replace */
  2517.         DO
  2518.           SAY '   Now reads:'
  2519.           SAY pen3||RIGHT(ednum,2)||def lynes.ednum
  2520.           OPTIONS PROMPT pen3'........Search text? >'def
  2521.           PARSE PULL stext
  2522.           IF LENGTH(stext)=0 THEN
  2523.             DO
  2524.               IF getinput(1 1 lineup||pen3'Replace entire line? (nY) >'def)='N' THEN
  2525.                 ITERATE edloop
  2526.               lynes.ednum=getinput(0 0 pen3||RIGHT(ednum,2)' 'def)
  2527.               notchanged=0
  2528.               ITERATE edloop
  2529.             END
  2530.           found=POS(UPPER(stext),UPPER(lynes.ednum))
  2531.           IF found=0 THEN
  2532.             DO
  2533.               SAY
  2534.               SAY stext' was not found!'
  2535.               SAY
  2536.               ITERATE edloop
  2537.             END
  2538.           OPTIONS PROMPT pen3'...Replacement text? >'def
  2539.           PARSE PULL rtext
  2540.           lynes.ednum=DELSTR(lynes.ednum,found,LENGTH(stext))
  2541.           lynes.ednum=INSERT(rtext,lynes.ednum,found-1)
  2542.           IF ednum<4 & LEFT(lynes.1,6)='File: ' THEN
  2543.             DO
  2544.               PARSE VAR lynes.1 'File: 'filenum . 'KeyWords: 'keywords
  2545.               PARSE VAR lynes.3 . 'Lib:' libnam
  2546.               filenum=STRIP(filenum)
  2547.               newc=files.filenum.0
  2548.               libnum=finddirnum(libnam)
  2549.               alpha.newc=LEFT(WORD(lynes.2,2),22-LENGTH(WORD(lynes.2,4)))
  2550.               alpha.newc=alpha.newc WORD(lynes.2,4) RIGHT(filenum,5)
  2551.               alpha.newc=alpha.newc RIGHT(libnum,2) LEFT(STRIP(libnam),12)
  2552.               alpha.newc=alpha.newc STRIP(LEFT(STRIP(keywords),32))
  2553.               savefileflag=1
  2554.             END
  2555.           SAY 'Done.'
  2556.           SAY 
  2557.           notchanged=0
  2558.         END
  2559.       ELSE IF edcom='I' THEN  /* insert */
  2560.         DO
  2561.           DO i=lynes.0 TO ednum BY -1
  2562.             j=i+1
  2563.             lynes.j=lynes.i
  2564.           END
  2565.           lynes.ednum=''
  2566.           notchanged=0
  2567.           lynes.0=lynes.0+1
  2568.           lynes.ednum=getinput(0 0 pen3||RIGHT(ednum,2)'>'def)
  2569.         END
  2570.       ELSE IF edcom='P' THEN   /* paste */
  2571.         DO
  2572.           DO i=lynes.0 TO ednum BY -1
  2573.             j=i+pasted.0
  2574.             lynes.j=lynes.i
  2575.           END
  2576.           DO k=1 TO pasted.0
  2577.             kk=ednum+k-1
  2578.             lynes.kk=pasted.k
  2579.           END
  2580.           notchanged=0
  2581.           lynes.0=lynes.0+pasted.0
  2582.         END
  2583.     END
  2584. END
  2585. RETURN 0
  2586.  
  2587.  
  2588. editor:
  2589. toname=''
  2590. msgnum=0
  2591. thechosen.=''
  2592. PARSE ARG edtype toname msgnum .
  2593. IF edtype='MAIL' THEN lastwrit=countcheck(bbspath'Numbers/LastMail 0')
  2594. ELSE 
  2595.   DO
  2596.     IF edtype='MSG' THEN
  2597.       DO
  2598.         tempmsgdir=0
  2599.         IF DATATYPE(arg,'N') THEN tempmsgdir=arg
  2600.         IF tempmsgdir>0 & tempmsgdir<=level & msg.tempmsgdir~='' THEN
  2601.           msgdir=tempmsgdir
  2602.         ELSE IF areaselect() THEN RETURN
  2603.       END
  2604.     lastwrit=countcheck(bbspath'Numbers/LastMessage'msgdir 0)
  2605.   END
  2606. IF toname='' THEN
  2607.   DO
  2608.     IF edtype='MAIL' THEN
  2609.       DO
  2610.         CALL selectchosen(1 pen3'Send' edtype lastwrit+1 'To: 'def)
  2611.         toname=thechosen.1
  2612.       END
  2613.     ELSE toname=getinput(1 0 pen3'Post Message To: 'def)
  2614.   END
  2615. toname=SPACE(STRIP(UPPER(toname)),1,'_')
  2616. toname=COMPRESS(toname,'.,:/*#?^ ')
  2617. IF toname='' | FIND(exclusion,toname)>0 THEN
  2618.   DO
  2619.     IF toname='' & edtype='MSG' THEN toname='ALL'
  2620.     ELSE toname=sysop
  2621.     SAY pen3'*** Re-Addressed to'def toname
  2622.   END
  2623. IF toname~='ALL' THEN
  2624.   DO
  2625.     IF toname='BBBBS' THEN toname=sysop
  2626.     IF FIND(userlist,toname)=0 THEN
  2627.       DO
  2628.         IF courtesy='' THEN CALL loadcourtesy()
  2629.         IF FIND(courtesy,toname)=0 THEN
  2630.           DO
  2631.             SAY
  2632.             SAY bak2' 'toname' is not on the user list! 'def
  2633.             IF edtype='MAIL' THEN
  2634.               DO
  2635.                 CALL showuserlist()
  2636.                 RETURN 0
  2637.               END
  2638.             ELSE
  2639.               DO
  2640.                 IF getinput(1 1 'Do you want to use it anyway? (nY) > ')='N' THEN
  2641.                   DO
  2642.                     IF getinput(1 1 'Do you want to see the list of current users? (Ny) > ')='Y' THEN
  2643.                       CALL showuserlist()
  2644.                     RETURN 0
  2645.                   END
  2646.               END
  2647.           END
  2648.       END
  2649.   END
  2650. IF edtype='MAIL' THEN
  2651.   DO
  2652.     CALL MAKEDIR(bbspath'EMail/'toname)
  2653.     mailname=bbspath'EMail/'toname'/'name'.'lastwrit+1
  2654.   END
  2655. ELSE
  2656.   DO
  2657.     CALL MAKEDIR(msgpath||msgdir)
  2658.     mailname=msgpath||msgdir'/'lastwrit+1
  2659.   END
  2660. lynes.=''
  2661. lynes.0=6
  2662. IF edtype='MAIL' THEN lynes.1=' Mail:' lastwrit+1  /* FILE: filename */
  2663. ELSE lynes.1='  Msg:' lastwrit+1          /* Msg: MSG# REPLY # # ... */
  2664. lynes.2=' From:' name
  2665. IF city~='' THEN lynes.2=lynes.2' - 'city
  2666. lynes.3='   To:' toname                       /*  To: toname   MSG # */
  2667. IF edtype='MAIL' THEN
  2668.   DO
  2669.     IF readopen(bbspath||'Users/'toname) THEN
  2670.       DO
  2671.         CALL READLN(f)
  2672.         CALL READLN(f)
  2673.         temp=READLN(f)
  2674.         CALL CLOSE(f)
  2675.         temp=docity(temp)
  2676.         IF temp~='' THEN lynes.3=lynes.3' - 'temp
  2677.       END
  2678.     IF replysubj='|@NEW@|' THEN
  2679.       DO
  2680.         CALL readlines(bbspath'BBS_TEXT/EMAIL_WELCOME' 7)
  2681.         replysubj='Welcome to' bbsname
  2682.       END
  2683.   END
  2684. subj=''
  2685. IF edtype='REPLY' THEN
  2686.   DO
  2687.     subj=SUBSTR(forthline,WORDINDEX(forthline,2))
  2688.     SAY pen3'Subj:'def subj
  2689.     temp=getinput(0 0 'Change the current subject? (Ny) > ')
  2690.     IF LENGTH(temp)>3 THEN subj=temp
  2691.     ELSE IF LEFT(UPPER(temp),1)='Y' THEN subj=''
  2692.   END
  2693. ELSE IF edtype='MAIL' & replysubj~='' THEN subj=replysubj
  2694. IF subj='' THEN
  2695.   DO
  2696.     IF opt='C' THEN subj='FEEDBACK'
  2697.     ELSE
  2698.       DO
  2699.         SAY pen3'Enter the'def 'Subject' pen3'of this message (1 line).'def
  2700.         subj=getinput(0 0 pen3': 'def)
  2701.       END
  2702.   END
  2703. IF LENGTH(subj)>66 THEN subj=LEFT(subj,66)
  2704. IF subj='' THEN subj='?'
  2705. lynes.4=' Subj:' subj
  2706. lynes.5=' Date:' DATE('W') DATE()'  'TIME('C')
  2707. IF edtype~='MAIL' THEN lynes.5=LEFT(lynes.5,39) 'Conference:' msg.msgdir
  2708. lynes.6=INSERT('','',1,74,'=')
  2709. IF edtype='REPLY' THEN lynes.3=lynes.3'  MSG 'msgnum
  2710. DO i=1 TO lynes.0
  2711.   SAY lynes.i
  2712. END
  2713. CALL writebuffer(scratch'/MessageLOCAL')
  2714. IF savelines(mailname) THEN RETURN 0
  2715. CALL seelines(1)
  2716. IF thechosen.0='' THEN
  2717.   DO
  2718.     thechosen.0=1
  2719.     thechosen.1=toname
  2720.   END
  2721. carbons=thechosen.0+1
  2722. DO FOREVER
  2723.   IF thechosen.0>=carbons THEN
  2724.     DO
  2725.       junk='Copies To:'
  2726.       DO cci=carbons TO thechosen.0
  2727.         junk=junk thechosen.cci
  2728.       END
  2729.       SAY junk
  2730.     END
  2731.   pline=''
  2732.   IF edtype='MAIL' THEN pline='['pen3'C'def']opies '
  2733.   pline=pline'['pen3'E'def']dit ['pen3'K'def']ill ['pen3'R'def']ead'
  2734.   pline=pline '['pen3'U'def']pload-Text ['pen3'S'def']end' edtype'? (ekrSu) 'def
  2735.   junk=getinput(1 1 pline)
  2736.   IF junk='E' THEN
  2737.     DO
  2738.       IF level>sysoplevel THEN firstedit=1
  2739.       ELSE firstedit=7
  2740.       IF bbsED(firstedit mailname)=2 THEN RETURN 0
  2741.       junk='R'
  2742.     END
  2743.   ELSE IF edtype='MAIL' & junk='C' THEN
  2744.     DO
  2745.       CALL selectchosen(carbons pen3'Carbon Copies To: 'def)
  2746.       junk='R'
  2747.     END
  2748.   ELSE IF junk='K' THEN
  2749.     DO
  2750.       IF DELETE(mailname)=1 THEN SAY edtype 'DELETED.'
  2751.       RETURN 0
  2752.     END
  2753.   ELSE IF junk='U' THEN
  2754.     DO
  2755.       SAY 'Ready to append' pen3'TEXT ONLY'def
  2756.       pline='Are you SURE your file is un-compressed text? (Ny) > '
  2757.       IF getinput(1 1 pline)='Y' THEN
  2758.         DO
  2759.           arg='UploadLOCAL'
  2760.           curdir=PRAGMA('D')
  2761.           CALL setdir(scratch)
  2762.           CALL DELETE(arg)
  2763.           CALL DELETE('tempLOCAL')
  2764.           IF uload(0)=0 THEN
  2765.             DO
  2766.               ADDRESS COMMAND 'C:copy' mailname 'tempLOCAL'
  2767.               CALL DELETE(mailname)
  2768.               ADDRESS COMMAND 'C:join tempLOCAL UploadLOCAL AS' mailname
  2769.             END
  2770.           CALL setdir(curdir)
  2771.         END
  2772.       junk='R'
  2773.     END
  2774.   IF junk='R' THEN
  2775.     DO
  2776.       CALL readlines(mailname 1)
  2777.       CALL seelines(1)
  2778.       nonstop=0
  2779.     END
  2780.   ELSE BREAK
  2781. END
  2782. IF edtype='MAIL' THEN
  2783.   DO
  2784.     IF replysubj~='' & readname~='' & uname~='' & uname~='UNAME' THEN
  2785.       DO
  2786.         junk=getinput(1 1 'Attach original mail from' uname'? (nY) > ')
  2787.         IF junk~='N' THEN
  2788.           DO
  2789.             arg=bbspath'Email/'name'/'readname
  2790.             IF ~readlines(arg 1) THEN CALL savelines(mailname)
  2791.           END
  2792.       END
  2793.     junk=getinput(1 1 pen3'Attach a file to this message? (Ny) > 'def)
  2794.     IF junk='Y' THEN
  2795.       DO
  2796.         arg=getinput(0 0 'Filename: ')
  2797.         curdir=PRAGMA('D')
  2798.         CALL MAKEDIR(bbspath'EmailFiles/'toname)
  2799.         CALL setdir(bbspath'EmailFiles/'toname)
  2800.         IF uload(0)=0 & WORD(STATEF(bbspath'EmailFiles/'toname'/'arg),2)>1 THEN
  2801.           DO
  2802.             CALL readlines(mailname 1)
  2803.             IF arg~='' THEN lynes.1=lynes.1'  FILE: 'arg
  2804.             CALL setdir(curdir)
  2805.             CALL DELETE(mailname)
  2806.             CALL savelines(mailname)
  2807.           END
  2808.         ELSE
  2809.           DO
  2810.             CALL DELETE(bbspath'EmailFiles/'toname'/'arg)
  2811.             SAY pen3'*** Upload failed! ***'def
  2812.           END
  2813.       END
  2814.     totmail=WORD(data.17,2)
  2815.     IF ~DATATYPE(totmail,'N') THEN totmail=1
  2816.     ELSE totmail=totmail+1
  2817.     data.17=WORD(data.17,1)'  'totmail'  'WORD(data.17,3)
  2818.   END
  2819. IF edtype~='MAIL' THEN totwrit.msgdir=totwrit.msgdir+1
  2820. CALL readlines(mailname 1)
  2821. DO ui=1 TO thechosen.0
  2822.   IF thechosen.ui='' THEN ITERATE ui
  2823.   IF ui>1 THEN
  2824.     DO
  2825.       CALL MAKEDIR(bbspath'Email/'thechosen.ui)
  2826.       newname=bbspath'Email/'thechosen.ui'/'name'.'lastwrit+1
  2827.       IF ui<carbons THEN lynes.3='   To:' thechosen.ui
  2828.       ELSE
  2829.         DO
  2830.           lynes.1=lynes.1'  (Carbon Copy)'
  2831.           lynes.3='   To:' thechosen.1
  2832.         END
  2833.       CALL savelines(newname)
  2834.       IF WORDS(lynes.1)>3 & EXISTS(bbspath'EmailFiles/'thechosen.1'/'WORD(lynes.1,4)) THEN
  2835.         DO
  2836.           CALL MAKEDIR(bbspath'EmailFiles/'thechosen.ui)
  2837.           ADDRESS COMMAND 'C:COPY' bbspath'EmailFiles/'thechosen.1'/'WORD(lynes.1,4) bbspath'EmailFiles/'thechosen.ui
  2838.           line2='Copied' WORD(lynes.1,4)
  2839.           SAY line2 'to the' thechosen.ui 'file area.'
  2840.         END
  2841.     END
  2842.   IF edtype~='MAIL' THEN
  2843.     DO
  2844.       IF FIND(userlist,thechosen.ui)>0 THEN
  2845.         CALL msgmark(thechosen.ui msgdir lastwrit+1)
  2846.     END
  2847.   IF GETCLIP('BBS_level')~='' & WORD(GETCLIP('BBS_lastcaller'),1)=thechosen.ui THEN
  2848.     DO
  2849.       temp='new Email.'
  2850.       IF edtype~='MAIL' THEN
  2851.         temp='a new message addressed to you in the'pen3 msg.msgdir def'conference.'
  2852.       oldmess=GETCLIP('BBS_MESSAGE')
  2853.       IF oldmess~='' THEN oldmess=oldmess||'0D0A'x
  2854.       CALL SETCLIP('BBS_MESSAGE',oldmess||'You have' temp)
  2855.     END
  2856.   line=edtype 'Sent To' thechosen.ui
  2857.   IF edtype='MAIL' THEN
  2858.     DO
  2859.       IF emailonline>=0 THEN emailonline=emailonline+1
  2860.     END
  2861.   ELSE
  2862.     DO
  2863.       grand=grand+1
  2864.       IF ~DATATYPE(msg.msgdir.0,'N') THEN msg.msgdir.0=1
  2865.       ELSE msg.msgdir.0=msg.msgdir.0+1
  2866.       line=line 'in the'pen3 msg.msgdir def'conference.'
  2867.     END
  2868.   SAY line
  2869. END
  2870. IF edtype='MAIL' THEN CALL countcheck(bbspath'Numbers/LastMail' lastwrit+1)
  2871. ELSE CALL countcheck(bbspath'Numbers/LastMessage'msgdir lastwrit+1)
  2872. CALL setdir(libpath||dirs.1)
  2873. thechosen.=''
  2874. RETURN 1
  2875.  
  2876.  
  2877. msgmark:
  2878. PARSE ARG markname markdir markmsg .
  2879. IF OPEN(f,bbspath'Users/'markname)=0 THEN RETURN
  2880. mlines.=''
  2881. DO mi=1 TO 24
  2882.   mlines.mi=READLN(f)
  2883. END
  2884. mlines.24=STRIP(mlines.24 markdir'/'markmsg)
  2885. CALL SEEK(f,0,'B')
  2886. DO mi=1 TO 24
  2887.   CALL WRITELN(f,mlines.mi)
  2888. END
  2889. CALL CLOSE(f)
  2890. RETURN
  2891.  
  2892.  
  2893. shell:
  2894. SAY
  2895. DO WHILE(UPPER(opt)~='EXIT')
  2896.   SAY bak2||TIME('C')||def PRAGMA('D')
  2897.   OPTIONS PROMPT pen3'Type EXIT to quit AmigaDOS> 'def
  2898.   PARSE PULL opt' 'arg .
  2899.   IF(UPPER(opt)='CD') THEN CALL setdir(arg)
  2900.   ELSE IF exists(opt)~=0 THEN
  2901.     DO
  2902.       IF LEFT(STATEF(opt),3)='DIR' THEN CALL setdir(opt)
  2903.     END
  2904.   ELSE IF opt~='' & UPPER(opt)~='EXIT' THEN
  2905.     ADDRESS COMMAND opt '<* >*' arg
  2906. END
  2907. RETURN
  2908.  
  2909.  
  2910. bbsspace:
  2911. ARG tabspace .
  2912. ADDRESS COMMAND 'C:info >ram:locinfout' bbsdevice
  2913. ok=OPEN(f,'ram:locinfout','R')
  2914. IF ok=0 THEN RETURN 20
  2915. line=READLN(f)
  2916. line=READLN(f)
  2917. line=READLN(f)
  2918. line=READLN(f)
  2919. CALL CLOSE(f)
  2920. IF tabspace<14 THEN SAY 
  2921. bbsk=WORD(line,4)
  2922. IF ~DATATYPE(bbsk,'N') THEN
  2923.   DO
  2924.     line=bbsdevice 'is not an info compatible device!'
  2925.     SAY pen3||line||def
  2926.     bbsk=0
  2927.     RETURN
  2928.   END
  2929. bbsk=bbsk*512-SYSTEM_SPACE_LIMIT
  2930. IF bbsk<1 THEN bbsk=0
  2931. SAY RIGHT(comma(bbsk),tabspace) 'bytes available for uploads.'
  2932. RETURN
  2933.  
  2934.  
  2935. comma:
  2936. ARG num .
  2937. dgt=LENGTH(num)
  2938. numtext=''
  2939. IF dgt>3 THEN numtext=','RIGHT(num,3)
  2940. IF dgt>6 THEN numtext=','LEFT(RIGHT(num,6),3)||numtext
  2941. IF dgt>9 THEN numtext=','LEFT(RIGHT(num,9),3)||numtext
  2942. IF dgt>12 THEN
  2943.   DO
  2944.     numtext=','LEFT(RIGHT(num,12),3)||numtext
  2945.     numtext=LEFT(num,dgt-12)||numtext
  2946.   END
  2947. ELSE IF dgt>9 THEN numtext=LEFT(num,dgt-9)||numtext
  2948. ELSE IF dgt>6 THEN numtext=LEFT(num,dgt-6)||numtext
  2949. ELSE IF dgt>3 THEN numtext=LEFT(num,dgt-3)||numtext
  2950. ELSE numtext=num
  2951. RETURN numtext
  2952.  
  2953.  
  2954. uload:
  2955. ARG frommenu
  2956. CALL bbsspace(12)
  2957. SAY
  2958. IF bbsk<1 THEN
  2959.   DO
  2960.     SAY pen3'Upload area is full!'def
  2961.     RETURN 1
  2962.   END
  2963. IF arg='' THEN arg=getinput(0 0 'Filename: ')   /* no filename given */
  2964. IF arg='' THEN RETURN 1
  2965. arg=COMPRESS(arg,' :/,;|')   /* be sure no illegals here */
  2966. IF frommenu THEN
  2967.   DO
  2968.     SAY 'Checking filelist...'
  2969.     filenum=countcheck(bbspath'Numbers/LastFile' 0)
  2970.     DO ui=1 TO filenum
  2971.       IF UPPER(WORD(files.ui,2))=UPPER(arg) THEN
  2972.         DO
  2973.           temp=WORD(files.ui,1)
  2974.           line=pen3'*** File' arg 'already exists here in the'
  2975.           line=line temp 'directory.'def
  2976.           SAY line
  2977.           SAY 'Original uploader should ['pen3'K'def']ill the file before uploading the replacement.'
  2978.           RETURN 1
  2979.         END
  2980.     END
  2981.     IF bbsprefs.6=1 & sysoplevel>level THEN CALL setdir(libpath'Sysops')
  2982.     ELSE
  2983.       DO loop=1
  2984.         SAY 'Please select an appropriate library for -' pen3||arg def'-'
  2985.         IF chdir()=0 THEN LEAVE loop
  2986.       END
  2987.   END
  2988. SAY ' Select File to Copy To' plaindir'/'arg
  2989. frompath=GETCLIP('BBS_frompath')
  2990. IF frompath='' THEN frompath=libpath'SysOps'
  2991. fromfile=GetFile(150,36,frompath,arg,' Select File to Copy ')
  2992. IF fromfile='' THEN RETURN 1
  2993. CALL SETCLIP('BBS_frompath',WORD(lastslash(fromfile),2))
  2994. ADDRESS COMMAND 'C:Copy' fromfile PRAGMA('D')'/'arg
  2995. IF POS('EMAILFILES',UPPER(PRAGMA('D')))>0 THEN RETURN 0
  2996. DO ui=sysoplevel+2 TO 100
  2997.   IF UPPER(dirs.ui)=UPPER(plaindir) THEN RETURN 0
  2998. END
  2999. IF frommenu THEN
  3000.   DO WHILE editnote(bbspath'FileNotes/'plaindir'/'arg) /* INSIST on a filenote */
  3001.   END
  3002. RETURN 0
  3003.  
  3004.  
  3005. findfiles:
  3006. PARSE ARG ffile .
  3007. IF POS('EMAILFILES',UPPER(PRAGMA('D')))>0 THEN RETURN ffile
  3008. IF DATATYPE(ffile,'N') THEN
  3009.   DO
  3010.     IF WORDS(files.ffile)<2 THEN RETURN 0
  3011.     dirtemp=WORD(files.ffile,1)
  3012.     IF finddirnum(dirtemp)>level | FIND(data.21,UPPER(dirtemp))>0 THEN
  3013.       DO
  3014.         CALL illegal_access()
  3015.         RETURN 0
  3016.       END
  3017.     CALL setdir(libpath||dirtemp)
  3018.   END
  3019. ELSE IF EXISTS(ffile) THEN
  3020.   DO
  3021.     IF EXISTS(bbspath'FileNotes/'plaindir'/'ffile) THEN
  3022.       DO
  3023.         IF readopen(bbspath'FileNotes/'plaindir'/'ffile)~=0 THEN
  3024.           DO
  3025.             line=READLN(f)
  3026.             CALL CLOSE(f)
  3027.             ffile=WORD(line,2)
  3028.           END
  3029.       END
  3030.   END
  3031. ELSE
  3032.   DO
  3033.     nextfilenum=countcheck(bbspath'Numbers/LastFile' 0)+1
  3034.     DO ui=nextfilenum TO 0 BY -1
  3035.       IF ui<1 THEN
  3036.         DO
  3037.           SAY '***' files.0 'filenames scanned,'pen3 ffile def'was not found!'
  3038.           RETURN 0
  3039.         END
  3040.       argtemp=WORD(files.ui,2)
  3041.       IF UPPER(argtemp)=UPPER(ffile) THEN
  3042.         DO
  3043.           dirtemp=WORD(files.ui,1)
  3044.           jj=files.ui.0
  3045.           IF WORD(alpha.jj,4)>level | FIND(data.21,UPPER(dirtemp))>0 THEN
  3046.             DO
  3047.               CALL illegal_access()
  3048.               RETURN 0
  3049.             END
  3050.           ffile=ui
  3051.           CALL setdir(libpath||dirtemp)
  3052.           LEAVE ui
  3053.         END
  3054.     END
  3055.   END
  3056. ftemp=ffile
  3057. IF DATATYPE(ftemp,'N') THEN ftemp=WORD(files.ftemp,2)
  3058. IF ~EXISTS(ftemp) THEN
  3059.   DO
  3060.     finfo=STATEF(bbspath'FileNotes/'plaindir'/'ftemp)
  3061.     IF WORDS(finfo)>7 THEN ftemp=WORD(finfo,8)
  3062.     IF ~EXISTS(ftemp) THEN
  3063.       DO
  3064.         IF finfo='' THEN SAY '***'pen3 PRAGMA('D')'/'ftemp def'was not found!'
  3065.         ELSE
  3066.           DO
  3067.             SAY
  3068.             SAY '***'pen3 plaindir'/'ftemp def'is not currently available online.'
  3069.             SAY 'Please leave email to your sysop'pen3 sysop||def', to receive this file.'
  3070.             SAY
  3071.           END
  3072.         RETURN 0
  3073.       END
  3074.   END
  3075. RETURN ffile
  3076.  
  3077.  
  3078. illegal_access:
  3079. SAY
  3080. SAY '*** You are not authorized to access' ffile'!'
  3081. SAY '*** Send Email to' sysop 'to receive a higher level.'
  3082. SAY
  3083. RETURN
  3084.  
  3085.  
  3086. showxdevs: PROCEDURE EXPOSE bbspath pen3 def 
  3087. CALL FileList(bbspath'Numbers/Files.X.*',xfiles,'F','N')
  3088. IF xfiles.0>1 THEN CALL QSORT(1,xfiles.0,xfiles)
  3089. DO i=1 TO xfiles.0
  3090.   ii=LASTPOS('FILES.X.',UPPER(xfiles.i))+8
  3091.   temp=SUBSTR(xfiles.i,ii)
  3092.   SAY RIGHT(comma(countcheck(bbspath'Numbers/Bytes.X.'temp 0)),15) 'bytes  in' RIGHT(comma(countcheck(bbspath'Numbers/Files.X.'temp 0)),7)' files downloaded from' pen3||temp||def
  3093. END
  3094. SAY LEFT('-',74,'-')
  3095. RETURN
  3096.  
  3097.  
  3098. ext_dload:
  3099. SAY
  3100. arg=bbsExtDL.baud(name level TRUNC(maxtime-TIME('E')) linesperpage colorflag extdevs)
  3101. IF arg~='' THEN SAY 'Sorry, LOCAL mode cannot download from the Extra Devices.'
  3102. RETURN
  3103.  
  3104.  
  3105. dload:
  3106. arg=STRIP(arg data.25)
  3107. data.25=''
  3108. errorflag=0
  3109. curdir=PRAGMA('D')
  3110. OPTIONS PROMPT 'Filename and/or number: '
  3111. IF arg='' THEN PARSE PULL arg  /* no filename given */
  3112. IF arg='' THEN RETURN
  3113. IF findfiles(arg)=0 THEN RETURN
  3114. arg=TRANSLATE(arg,'  ',':/')
  3115. IF WORDS(arg)>1 THEN arg=WORD(arg,1)
  3116. IF arg~='' THEN           /* check for filename */
  3117.   DO dloadloop=1
  3118.     frompath=GETCLIP('BBS_frompath')
  3119.     IF frompath='' THEN frompath=libpath'SysOps/'
  3120.     notename=bbspath'FileNotes/'plaindir'/'arg
  3121.     IF ~EXISTS(arg) THEN
  3122.       DO
  3123.         finfo=STATEF(notename)
  3124.         IF WORDS(finfo)>7 THEN
  3125.           DO
  3126.             temp=plaindir
  3127.             x=lastslash(WORD(finfo,8))
  3128.             arg=WORD(x,1)
  3129.             CALL setdir(WORD(x,2))
  3130.             plaindir=temp
  3131.           END
  3132.       END
  3133.     topath=PRAGMA('D')
  3134.     num=LASTPOS('/',arg)
  3135.     IF num=0 THEN num=LASTPOS(':',arg)
  3136.     IF num>0 THEN
  3137.       DO
  3138.         topath=LEFT(arg,num)
  3139.         arg=SUBSTR(arg,num+1)
  3140.       END
  3141.     IF RIGHT(topath,1)~=':' & RIGHT(topath,1)~='/' THEN topath=topath'/'
  3142.     SAY ' Select Filename to Copy ' topath||arg 'To:'
  3143.     tofile=GetFile(150,36,frompath,arg,' Select Destination Name ')
  3144.     IF tofile='' THEN
  3145.       DO
  3146.         errorflag=1
  3147.         LEAVE dloadloop
  3148.       END
  3149.     ADDRESS COMMAND 'C:Copy' topath||arg tofile
  3150.     CALL SETCLIP('BBS_frompath',WORD(lastslash(tofile),2))
  3151.     IF POS('EMAILFILES',UPPER(PRAGMA('D')))>0 THEN LEAVE dloadloop
  3152.     DO di=sysoplevel+2 TO 100
  3153.       IF UPPER(dirs.di)=UPPER(plaindir) THEN LEAVE dloadloop
  3154.     END
  3155.     IF readlines(notename 1) THEN LEAVE dloadloop
  3156.     dls=WORD(lynes.2,7)
  3157.     IF ~DATATYPE(dls,'N') THEN dls=0
  3158.     lynes.2=STRIP(DELWORD(lynes.2,7,1)) dls+1
  3159.     finfo=STATEF(notename)
  3160.     IF WORDS(finfo)>7 THEN finfo=SUBSTR(finfo,WORDINDEX(finfo,8))
  3161.     ELSE finfo=''
  3162.     CALL DELETE(notename)
  3163.     CALL savelines(notename)
  3164.     CALL DELAY(28)
  3165.     IF finfo~='' THEN ADDRESS COMMAND 'C:FileNote' notename finfo
  3166.     LEAVE dloadloop
  3167.   END
  3168. CALL setdir(curdir)
  3169. IF errorflag THEN SAY pen3'*** Download Failed!'def
  3170. RETURN
  3171.  
  3172.  
  3173. lastslash:
  3174. PARSE ARG sarg 
  3175. sdir=''
  3176. slash=LASTPOS('/',sarg)
  3177. IF slash>2 THEN sdir=LEFT(sarg,slash-1)
  3178. ELSE
  3179.   DO
  3180.     slash=LASTPOS(':',sarg)
  3181.     IF slash>0 THEN sdir=LEFT(sarg,slash)
  3182.   END
  3183. IF slash>0 THEN sarg=SUBSTR(sarg,slash+1)
  3184. RETURN sarg sdir
  3185.  
  3186.  
  3187. editnote:
  3188. IF arg='' THEN
  3189.   DO
  3190.     PARSE PULL arg .
  3191.     IF arg='' THEN RETURN 0
  3192.   END
  3193. comment=''
  3194. IF ~EXISTS(arg) THEN
  3195.   DO
  3196.     finfo=STATEF(bbspath'FileNotes/'plaindir'/'arg)
  3197.     fromarg=arg
  3198.     fromdir=GETCLIP('BBS_frompath')
  3199.     IF WORDS(finfo)>7 THEN
  3200.       DO
  3201.         temp='Y'
  3202.         fromdir=WORD(finfo,8)
  3203.         fromdir=lastslash(fromdir)
  3204.         fromarg=WORD(fromdir,1)
  3205.         fromdir=WORD(fromdir,2)
  3206.       END
  3207.     ELSE
  3208.       DO
  3209.         IF level<sysoplevel THEN RETURN 0
  3210.         temp=getinput(1 1 'Is this file on an another device? (Nqy)')
  3211.       END
  3212.     IF fromdir='' THEN fromdir=libpath'Sysops'
  3213.     IF temp='Y' THEN
  3214.       DO WHILE comment=''
  3215.         comment=GetFile(150,36,fromdir,fromarg,' Select Linked File ')
  3216.         IF comment='' THEN RETURN 0
  3217.         IF ~EXISTS(comment) THEN comment=''
  3218.         ELSE CALL SETCLIP('BBS_frompath',WORD(lastslash(comment),2))
  3219.       END
  3220.     ELSE IF temp~='N' THEN RETURN 0
  3221.   END
  3222. IF comment='' THEN
  3223.   DO
  3224.     arg=findfiles(arg)
  3225.     IF arg=0 THEN RETURN 0
  3226.     IF DATATYPE(arg,'N') THEN arg=WORD(files.arg,2)
  3227.   END
  3228. filedir=plaindir
  3229. slash=LASTPOS('/',arg)
  3230. IF slash=0 THEN slash=LASTPOS(':',arg)
  3231. IF slash>0 THEN
  3232.   DO
  3233.     filedir=LEFT(arg,slash-1)
  3234.     filedir=SUBSTR(filedir,5)
  3235.     arg=SUBSTR(arg,slash+1)
  3236.   END
  3237. ELSE filedir=plaindir
  3238. CALL MAKEDIR(bbspath'FileNotes/'filedir)
  3239. IF ~EXISTS(bbspath'FileNotes/'filedir) THEN
  3240.   DO
  3241.     SAY pen3'*** Failed to open directory!' filedir||def
  3242.     RETURN 0
  3243.   END
  3244. notename=bbspath'FileNotes/'filedir'/'arg
  3245. lynes.=''
  3246. filenum=countcheck(bbspath'Numbers/LastFile' 0)
  3247. IF level>sysoplevel THEN firstedit=1
  3248. ELSE firstedit=5
  3249. IF EXISTS(notename) THEN
  3250.   DO
  3251.     IF comment~='' THEN ADDRESS COMMAND 'C:filenote' notename comment
  3252.     CALL bbsED(firstedit notename)
  3253.     RETURN 0
  3254.   END
  3255. IF comment='' THEN filedata=STATEF(libpath||filedir'/'arg)
  3256. ELSE filedata=STATEF(comment)
  3257. IF filedata='' THEN
  3258.   DO
  3259.     IF comment='' THEN line=filedir'/'arg
  3260.     ELSE line=comment
  3261.     SAY line 'does not exist!'
  3262.     RETURN 0
  3263.   END
  3264. bytes=WORD(filedata,2)
  3265. filenum=filenum+1
  3266. lynes.0=4
  3267. lynes.1='File: 'LEFT(filenum,5)' KeyWords:'
  3268. lynes.2='Name: 'LEFT(arg,27)' Size: 'bytes' bytes   Downloads: 0'
  3269. lynes.3='From: 'LEFT(name,27)' Date: 'DATE() TIME('C')'  Lib: 'filedir
  3270. lynes.4=INSERT('','',1,74,'=')
  3271. lynes.1=lynes.1 edkeywords(arg filedir)
  3272. CALL seelines(1)
  3273. edtype=''
  3274. CALL writebuffer(scratch'/NoteLOCAL')
  3275. IF savelines(notename) THEN RETURN 0
  3276. IF comment~='' THEN ADDRESS COMMAND 'C:filenote' notename comment
  3277. fncom='R'
  3278. DO WHILE fncom='R'
  3279.   CALL seelines(1)
  3280.   nonstop=0
  3281.   line='['pen3'E'def']dit'
  3282.   IF level>sysoplevel THEN line=line '['pen3'K'def']ill'
  3283.   line=line '['pen3'R'def']ead ['pen3'S'def']ave'
  3284.   IF level>sysoplevel THEN line=line '(ekrS) 'def
  3285.   ELSE line=line '(erS) 'def
  3286.   fncom=getinput(1 1 line)
  3287.   IF fncom='K' & level>sysoplevel THEN
  3288.     DO
  3289.       SAY 'Killing FileNote..'
  3290.       CALL DELETE(notename)
  3291.       RETURN 1
  3292.     END
  3293.   ELSE IF fncom='E' THEN
  3294.     DO
  3295.       IF bbsED(firstedit notename)>0 THEN RETURN 0
  3296.       fncom='R'
  3297.     END
  3298.   ELSE IF fncom~='R' THEN
  3299.     DO
  3300.       SAY 'Adjusting filelist...'
  3301.       IF filenum<1 THEN filenum=1
  3302.       IF GETCLIP('BBS_level')~='' THEN CALL SETCLIP('BBS_localfiles',1)
  3303.       CALL countcheck(bbspath'Numbers/LastFile' filenum)
  3304.       files.0=files.0+1
  3305.       newcount=alpha.0+1
  3306.       alpha.0=newcount
  3307.       files.filenum=plaindir arg
  3308.       files.filenum.0=newcount
  3309.       libnum=finddirnum(plaindir)
  3310.       PARSE VAR lynes.1 . 'KeyWords:' keywords
  3311.       alpha.newcount=LEFT(arg,22-LENGTH(WORD(lynes.2,4)))
  3312.       alpha.newcount=alpha.newcount WORD(lynes.2,4) RIGHT(filenum,5)
  3313.       alpha.newcount=alpha.newcount RIGHT(libnum,2) LEFT(plaindir,12)
  3314.       alpha.newcount=alpha.newcount STRIP(LEFT(STRIP(keywords),32))
  3315.       IF EXISTS(bbspath'Lists/Files') THEN
  3316.         x=OPEN(f,bbspath'Lists/Files','A')
  3317.       ELSE x=OPEN(f,bbspath'Lists/Files','W')
  3318.       IF x=0 THEN
  3319.         DO
  3320.           SAY '*** Failed to open' bbspath'Lists/Files'
  3321.           RETURN 0
  3322.         END
  3323.       CALL WRITELN(f,filenum files.filenum)
  3324.       CALL CLOSE(f)
  3325.       IF EXISTS(bbspath'Lists/Files.ALPHA') THEN
  3326.         x=OPEN(f,bbspath'Lists/Files.ALPHA','A')
  3327.       ELSE x=OPEN(f,bbspath'Lists/Files.ALPHA','W')
  3328.       IF x=0 THEN
  3329.         DO
  3330.           SAY '*** Failed to open' bbspath'Lists/Files.ALPHA'
  3331.           RETURN 0
  3332.         END
  3333.       CALL WRITELN(f,alpha.newcount)
  3334.       CALL CLOSE(f)
  3335.       sortalphaflag=1
  3336.       savefileflag=1
  3337.     END
  3338. END
  3339. RETURN 0
  3340.  
  3341.  
  3342. edkeywords:
  3343. PARSE ARG kwarg
  3344. SAY
  3345. SAY pen3'Please enter a list of keywords (or a condensed description)'def
  3346. SAY pen3'to be used in the alphabetic list and by the search routine.'def
  3347. SAY '    Note that only the first 32 characters will be used.'
  3348. SAY INSERT('','',1,74,'=')
  3349. templine=getinput(0 0 ' 'RIGHT(STRIP(RIGHT(kwarg,32)),32) pen3'KeyWords: 'def)
  3350. SAY
  3351. RETURN STRIP(LEFT(templine,32))
  3352.  
  3353.  
  3354. loadfiles:
  3355. SAY def
  3356. SAY 'Loading filelist...'
  3357. files.=''
  3358. files.0=0
  3359. IF readopen(bbspath'Lists/Files') THEN
  3360.   DO
  3361.     DO i=1
  3362.       line=READLN(f)
  3363.       IF EOF(f) THEN BREAK
  3364.       num=WORD(line,1)
  3365.       IF DATATYPE(num,'N') THEN files.num=WORD(line,2) WORD(line,3)
  3366.     END
  3367.     files.0=i-1
  3368.     CALL CLOSE(f)
  3369.   END
  3370. RETURN
  3371.  
  3372.  
  3373. savefilelist:
  3374. IF level=99 THEN
  3375.   IF getinput(1 1 'Update filelists now? (nY) > ')='N' THEN
  3376.     RETURN
  3377.  
  3378. savefilelist2:
  3379. SIGNAL OFF BREAK_E
  3380. IF ckmaint('FILES') THEN RETURN
  3381. CALL savealphalist()
  3382. SAY 'Saving filelist...'
  3383. CALL SETCLIP('BBS_maint',1)
  3384. xarg=bbspath'Lists/Files'
  3385. CALL DELETE(xarg)
  3386. filenum=countcheck(bbspath'Numbers/LastFile' 0)
  3387. IF filenum<1 | writeopen(xarg)=0 THEN RETURN
  3388. DO i=1 TO filenum
  3389.   IF files.i='' THEN ITERATE
  3390.   CALL WRITELN(f,i files.i)
  3391. END
  3392. CALL CLOSE(f)
  3393. CALL SETCLIP('BBS_maint')
  3394. savefileflag=0
  3395. IF SHOW('P','BBBBS') THEN CALL SETCLIP('BBS_localfiles',2)
  3396. RETURN
  3397.  
  3398.  
  3399. loadalpha:
  3400. SAY def
  3401. SAY 'Loading the alphabetical filelist...'
  3402. IF readopen(bbspath'Lists/Files.ALPHA') THEN
  3403.   DO
  3404.     alpha.=''
  3405.     alpha.0=0
  3406.     DO i=1
  3407.       line=READLN(f)
  3408.       IF EOF(f) THEN BREAK
  3409.       fnum=WORD(line,3)
  3410.       IF DATATYPE(fnum,'N') THEN
  3411.         DO
  3412.           alpha.i=line
  3413.           files.fnum.0=i
  3414.         END
  3415.       ELSE i=i-1
  3416.     END
  3417.     alpha.0=i-1
  3418.     CALL CLOSE(f)
  3419.   END
  3420. ELSE SAY pen3'*** Lists/Files.ALPHA failed to open for reading!'def
  3421. SAY
  3422. RETURN
  3423.  
  3424.  
  3425. ckmaint:
  3426. ARG ckfile .
  3427. IF GETCLIP('BBS_maint')~='' THEN
  3428.   DO
  3429.     DO i=0 TO 23 WHILE GETCLIP('BBS_maint')~=''
  3430.       IF i//2=0 THEN SAY 'Waiting' (24-i)*5 'more seconds for' ckfile 'list update to finish...'
  3431.       CALL DELAY(250)
  3432.     END
  3433.     IF i>23 THEN
  3434.       DO
  3435.         SAY '*** unable to update' ckfile 'list.'
  3436.         RETURN 1
  3437.       END
  3438.   END
  3439. RETURN 0
  3440.  
  3441.  
  3442. savealphalist:
  3443. SIGNAL OFF BREAK_E
  3444. IF ckmaint('ALPHA') THEN RETURN
  3445. IF GETCLIP('BBS_mainfiles')~='' & GETCLIP('BBS_maint')='' THEN
  3446.   DO
  3447.     CALL SETCLIP('BBS_mainfiles')
  3448.     CALL loadfiles()
  3449.     CALL loadalpha()
  3450.   END
  3451. CALL SETCLIP('BBS_maint',1)
  3452. aarg=bbspath'Lists/Files.ALPHA'
  3453. CALL DELETE(aarg)
  3454. IF sortalphaflag=1 THEN
  3455.   DO
  3456.     SAY 'Alphabetizing' alpha.0 'files...'
  3457.     CALL QSORT(1,alpha.0,alpha)
  3458.     DO i=1 TO alpha.0
  3459.       fnum=WORD(alpha.i,3)
  3460.       files.fnum.0=i
  3461.     END
  3462.   END
  3463. sortalphaflag=0
  3464. IF writeopen(aarg)=0 THEN
  3465.   DO
  3466.     SAY '*** Error opening' aarg '!'
  3467.     RETURN
  3468.   END
  3469. SAY 'Saving alphabetical filelist...'
  3470. DO i=1 TO alpha.0
  3471.   ii=WORD(alpha.i,3)
  3472.   IF files.ii='' THEN alpha.i='0 0' ii '100'
  3473.   IF LEFT(alpha.i,4)~='0 0 ' THEN CALL WRITELN(f,alpha.i)
  3474. END
  3475. CALL CLOSE(f)
  3476. CALL SETCLIP('BBS_maint')
  3477. CALL bbsALPHA.rexx SUBSTR(extension,2) arccom
  3478. RETURN
  3479.  
  3480.  
  3481. viewuser:
  3482. SAY 
  3483. SAY bak2' 'name' 'def
  3484. DO i=1 TO 18
  3485.   stuff=data.i
  3486.   IF i=13 | i=14 THEN stuff=DATE(,data.i,'S')
  3487.   SAY RIGHT(i,2)||pen3 text.i||def':' stuff
  3488. END
  3489. CALL waiting()
  3490. RETURN
  3491.  
  3492.  
  3493. edituser:
  3494. IF getinput(1 1 'Change ['pen3'U'def']ser data or ['pen3'M'def']essage conference access (mU) > ')='M' THEN
  3495.   DO
  3496.     SAY
  3497.     SAY pen3'     - Message Conference Access -'def
  3498.     SAY '[O]ff turns all message conferences OFF.'
  3499.     SAY 'Set the last message read by you in ALL message conferences'
  3500.     temp=getinput(1 1 ' ['pen3'L'def']ast  ['pen3'F'def']irst  ['pen3'O'def']ff  ['pen3'Q'def']uit  (fLoq) > ')
  3501.     IF temp='Q' THEN RETURN
  3502.     SAY 'Resetting...'lineup
  3503.     data.22=''
  3504.     DO i=1 TO level
  3505.       IF temp='F' THEN num=0
  3506.       ELSE IF temp='O' THEN num=-1
  3507.       ELSE num=countcheck(bbspath'Numbers/LastMessage'i 0)
  3508.       data.22=data.22 num
  3509.     END
  3510.     CALL SetData()
  3511.     CALL sortconferences()
  3512.     CALL savedata(1)
  3513.     RETURN
  3514.   END
  3515. new=0
  3516. change=0
  3517. edata.=''
  3518. edname=name
  3519. DO i=0 TO data.0
  3520.   edata.i=data.i
  3521. END
  3522. num=1
  3523. DO WHILE num~='' | edname~=name
  3524.   IF num='' THEN
  3525.     DO
  3526.       IF change THEN
  3527.         DO
  3528.           CALL SetData()
  3529.           CALL saveData(1)
  3530.           change=0
  3531.         END
  3532.       IF new THEN
  3533.         DO
  3534.           data.=''
  3535.           DO i=0 TO edata.0
  3536.             data.i=edata.i
  3537.           END
  3538.           name=edname
  3539.           new=0
  3540.         END
  3541.       CALL SetData()
  3542.     END
  3543.   maxnum=10
  3544.   IF edata.20>sysoplevel THEN maxnum=20
  3545.   IF edata.20=99 THEN maxnum=24
  3546.   SAY bak2' 'name' 'def
  3547.   maxlines=21
  3548.   IF maxnum=10 THEN maxlines=20
  3549.   DO i=1 TO maxlines
  3550.     IF i=5 & name~=edname & edata.20<99 THEN ITERATE
  3551.     SAY RIGHT(i,2)||pen3 text.i||def':' data.i
  3552.   END
  3553.   IF edata.20>sysoplevel THEN
  3554.     DO
  3555.       line=LEFT(' ',50)
  3556.       IF name=edname THEN line=line'NEW = Change User.'
  3557.       line=pen3||line||def||lineup
  3558.       SAY line
  3559.     END
  3560.   num=getinput(1 0 'Select Line Number To Edit: ')
  3561.   IF num='NEW' & edata.20>sysoplevel & edname=name THEN    /* select a new user */
  3562.     DO
  3563.       new=1
  3564.       IF change THEN
  3565.         DO
  3566.           CALL SetData()
  3567.           CALL saveData(1)
  3568.         END
  3569.       change=0
  3570.       nufile=bbspath'Lists/NEW_USERS'
  3571.       IF EXISTS(nufile) THEN
  3572.         IF ~readlines(nufile 1) THEN CALL seelines(0)
  3573.       savename=name
  3574.       name=getinput(1 0 'New User Name: 'def)
  3575.       name=SPACE(name,1,'_')
  3576.       name=COMPRESS(name,':/*#?^')
  3577.       IF loadData()=0 THEN name=savename
  3578.       IF data.20>=edata.20 THEN
  3579.         DO
  3580.           SAY 'Can''t Edit!' pen3||name def'has an equal or higher level than thee.'
  3581.           name=savename
  3582.           CALL loadData()
  3583.         END
  3584.     END
  3585.   ELSE IF DATATYPE(num,'N') & num>0 THEN
  3586.     DO
  3587.       IF num>maxnum THEN
  3588.         DO
  3589.           SAY 
  3590.           SAY pen3'You are not authorized to change that information!'def
  3591.           SAY 
  3592.         END
  3593.       ELSE
  3594.         DO dummy=1 TO 1
  3595.           IF num=8 THEN
  3596.             DO
  3597.               SAY
  3598.               SAY 'Use spaces to seperate options.'
  3599.               SAY 'If the option word is in line 8, it is ON.'
  3600.               SAY 'Valid Options:'
  3601.               SAY '        MENU   combines all main commands into 1 menu.'
  3602.               SAY '        MENUS  splits main commands into 3 menus.'
  3603.               SAY '        COLOR  turns ANSI color codes ON.'
  3604.               SAY '        PHONE  makes your phone number public.'
  3605.               SAY '        STREET makes your street address public.'
  3606.               SAY '        TERSE  skips some of the logon procedures.'
  3607.               SAY
  3608.             END
  3609.           line=RIGHT(num,2)||pen3 text.num||def': '
  3610.           SAY line||data.num
  3611.           temp=getinput(0 0 line)
  3612.           IF temp='' THEN
  3613.             DO
  3614.               IF num=1 | num=4 | num=5 | num=6 | num=7 THEN LEAVE dummy
  3615.               IF num=11 | num=12 | num=13 | num=20 THEN LEAVE dummy
  3616.             END
  3617.           IF num=5 | num=8 THEN temp=UPPER(temp)
  3618.           IF num=20 & DATATYPE(temp,'N') & temp>=edata.20 THEN
  3619.             temp=data.20
  3620.           IF edata.20>sysoplevel & name~=edname THEN line2=name' '
  3621.           ELSE line2=''
  3622.           IF num=21 & name=edname & edata.20<99 THEN LEAVE dummy
  3623.           line=text.num':' data.num pen6'CHANGED TO'def temp
  3624.           data.num=temp
  3625.           SAY line
  3626.           SAY 
  3627.           change=1
  3628.         END
  3629.     END
  3630. END
  3631. IF change THEN
  3632.   DO
  3633.     CALL SetData()
  3634.     CALL saveData(1)
  3635.   END
  3636. RETURN
  3637.  
  3638.  
  3639. getnumber:
  3640. PARSE ARG tprompt
  3641. tnum=''
  3642. DO WHILE ~DATATYPE(tnum,'N')
  3643.   tnum=getinput(1 0 '  'tprompt' > ')
  3644.   mask=COMPRESS(XRANGE(),'0123456789')
  3645.   tnum=COMPRESS(tnum,mask)%1
  3646. END
  3647. IF tnum>0 & tnum<10 THEN tnum='0'tnum
  3648. RETURN tnum
  3649.  
  3650.  
  3651. getbirth:
  3652. data.12=WORD(data.12,1)'  'WORD(data.12,2)'  Birthday:'
  3653. SAY pen3'Please enter your birthday.'def
  3654. month=getnumber('month: (1-12)')
  3655. day=getnumber('  day: (1-31)')
  3656. year=getnumber(' year:       ')
  3657. IF year<100 THEN year=year+1900
  3658. born=year||month||day
  3659. IF born<18750101 | born>DATE('S') THEN
  3660.   DO
  3661.     born=''
  3662.     IF getinput(1 1 'Would you rather skip this question? (Ny) > ')~='Y' THEN
  3663.       CALL getbirth()
  3664.   END
  3665. data.12=WORD(data.12,1)'  'WORD(data.12,2)'  'WORD(data.12,3)' 'WORD(born,1)
  3666. RETURN
  3667.  
  3668.  
  3669. getname:
  3670. CALL showuserlist()
  3671. SAY
  3672. name=getinput(1 0 'Please enter your full Email name : ')
  3673. IF name='' THEN
  3674.   DO
  3675.     SAY 'No name, no entry.  Bye!'
  3676.     SIGNAL DONE
  3677.   END
  3678. name=SPACE(name,1,'_')
  3679. name=COMPRESS(name,':/*#?^')
  3680. IF FIND(userlist,name)>0 | FIND(exclusion,name)>0 THEN
  3681.   DO
  3682.     SAY 'Sorry! That name is taken. Please try again.'
  3683.     RETURN 1
  3684.   END
  3685. RETURN 0
  3686.  
  3687.  
  3688. /** see if name is in data */
  3689.  
  3690. checkUser:
  3691. tries=0
  3692. IF name='NEW' THEN
  3693.   DO
  3694.     name=''
  3695.     DO WHILE getname()
  3696.     END
  3697.   END
  3698. IF FIND(userlist,name)=0 THEN
  3699.   DO
  3700.     IF EXISTS(bbspath'BBS_TEXT/NEW') THEN
  3701.       DO
  3702.         nonstop=0
  3703.         CALL readlines(bbspath'BBS_TEXT/NEW' 1)
  3704.         CALL seelines(0)
  3705.         CALL waiting()
  3706.       END
  3707.     SAY
  3708.     defile=bbspath'BBS_TEXT/DEF.NEW_USER'
  3709.     CALL loadcourtesy()
  3710.     wordnum=FIND(courtesy,name)
  3711.     IF wordnum>0 THEN
  3712.       DO
  3713.         SAY name', is on the Courtesy List. You will be granted immediate access.'
  3714.         courtesy=STRIP(DELWORD(courtesy,wordnum,1))
  3715.         IF writeopen(bbspath'Lists/Courtesy') THEN
  3716.           DO
  3717.             DO i=1 TO WORDS(courtesy)
  3718.               CALL WRITELN(f,WORD(courtesy,i))
  3719.             END
  3720.             CALL CLOSE(f)
  3721.           END
  3722.         defile=bbspath'BBS_TEXT/DEF.COURTESY'
  3723.       END
  3724.     ELSE IF bbsprefs.7=0 THEN SAY name', You have new user access.'
  3725.     IF readlines(defile 1) THEN SIGNAL DONE
  3726.     data.=''
  3727.     data.0=24
  3728.     DO i=6 TO 22
  3729.       data.i=lynes.i
  3730.     END
  3731.     data.12=DATE('S')'  'TIME('C')
  3732.     data.13=data.12
  3733.     lastondate=DATE('I')-1
  3734.     lastontime=TIME('C')
  3735.     SAY 'Please enter the password you would like to use here.'
  3736.     data.5=getinput(1 0 'Password: ')
  3737.     IF data.5='' THEN
  3738.       DO
  3739.         line=''name 'refused to enter a password.'
  3740.         SIGNAL DONE
  3741.       END
  3742.     data.1=''
  3743.     DO WHILE data.1=''
  3744.       data.1=getinput(0 0 'Full Name: ')
  3745.       IF data.1='' THEN SAY 'You MUST leave your real name!'
  3746.     END
  3747.     data.2=getinput(0 0 'Street: ')
  3748.     data.3=getinput(0 0 'City, State Zip: ')
  3749.     data.4=''
  3750.     DO WHILE data.4=''
  3751.       data.4=getinput(0 0 'Phone: ')
  3752.       IF data.4='' THEN
  3753.         SAY sysop 'MUST be able to reach you by phone to validate you!'
  3754.     END
  3755.     CALL getbirth()
  3756.     IF bbsprefs.8 THEN
  3757.       DO
  3758.         newufile=bbspath'Lists/NEW_USERS'
  3759.         IF EXISTS(newufile) THEN ok=OPEN(f,newufile,'A')
  3760.         ELSE
  3761.           DO
  3762.             ok=OPEN(f,newufile,'W')
  3763.             IF ok~=0 THEN CALL WRITELN(f,'*** New Users ***')
  3764.           END
  3765.         IF ok~=0 THEN CALL WRITELN(f,DATE() TIME() name' = 'data.1'   'data.4)
  3766.         CALL CLOSE(f)
  3767.       END
  3768.     data.9=getinput(0 0 'Computer: ')
  3769.     data.10=getinput(0 0 'Interests: ')
  3770.     test=getinput(1 1 pen3'Do you want other users to see your STREET address? (Ny) > 'def)
  3771.     IF test='Y' THEN data.8=data.8 'STREET'
  3772.     test=getinput(1 1 pen3'Do you want other users to see your PHONE number? (Ny) > 'def)
  3773.     IF test='Y' THEN data.8=data.8 'PHONE'
  3774.     IF bbsprefs.7>0 THEN
  3775.       DO
  3776.         data.20=bbsprefs.7
  3777.         data.11='60 minutes' bbsprefs.16-1 'more times today'
  3778.       END
  3779.     SAY
  3780.     IF data.20=0 THEN
  3781.       SAY 'Thank you, the sysop will give you higher access soon.'
  3782.     SAY 'Please feel free to leave additional info by using [C]omment.'
  3783.     SAY
  3784.     CALL SetData()
  3785.     CALL saveData(1)
  3786.     SAY 'Adding' name 'to the user list...'
  3787.     newpassword=data.5
  3788.     sortuserflag=1
  3789.     temp=countcheck(bbspath'Numbers/Users' 0)+1
  3790.     CALL countcheck(bbspath'Numbers/Users' temp)
  3791.     CALL DELETE(bbspath'Lists/USERS')
  3792.   END
  3793. ELSE
  3794.   DO
  3795.     IF loadData()=0 THEN SIGNAL DONE
  3796.     PARSE VAR data.11 amins . atimes .
  3797.     lastondate=DATE('I',WORD(data.13,1),'S')
  3798.     lastontime=WORD(data.13,2)
  3799.     IF DATE('I')>lastondate | level>sysoplevel THEN atimes=bbsprefs.16
  3800.     IF level=99 THEN amins=120
  3801.     data.13=DATE('S')'  'TIME()
  3802.     data.11=amins 'minutes' atimes-1 'more times today'
  3803.     passprompt='Enter Password: '
  3804.     DO tries=1 TO 3
  3805.       OPTIONS PROMPT passprompt
  3806.       PULL newpassword
  3807.       SAY ''
  3808.       IF(password=newpassword) THEN LEAVE tries; /* correct password */
  3809.       IF tries=3 THEN
  3810.         DO
  3811.           SAY 
  3812.           SAY 'Access terminated.'
  3813.           line='*** Bad password ***' newpassword '***'
  3814.           SAY line
  3815.           SIGNAL OUT2
  3816.         END
  3817.       SAY lineup'                                 '
  3818.       passprompt='Incorrect.  Password: ' /* ask again */
  3819.     END
  3820.   END
  3821. CALL DELAY(14)
  3822. SAY 
  3823. RETURN
  3824.  
  3825.  
  3826. saveData:
  3827. ARG messflag .
  3828. IF data.5='' THEN RETURN
  3829. SAY 'Updating...             'lineup
  3830. IF newfilesdate~='' THEN data.16=lastbrowse newfilesdate
  3831. ELSE IF lastbrowse>0 THEN
  3832.   DO
  3833.     IF WORDS(data.16)>1 THEN data.16=DELWORD(data.16,1,1)
  3834.     ELSE data.16=DATE('S') TIME()
  3835.     data.16=lastbrowse data.16
  3836.   END
  3837. IF messflag THEN
  3838.   DO
  3839.     userexclude.=0
  3840.     DO si=1 TO WORDS(data.22)
  3841.       IF WORD(data.22,si)=-1 THEN userexclude.si=1
  3842.     END
  3843.     data.22=''
  3844.     data.23=''
  3845.     DO si=1 TO level
  3846.       IF ~DATATYPE(lastread.si,'N') THEN lastread.si=0
  3847.       IF userexclude.si THEN data.22=data.22 '-1'
  3848.       ELSE data.22=data.22 lastread.si
  3849.       IF ~DATATYPE(totwrit.si,'N') THEN totwrit.si=0
  3850.       data.23=data.23 totwrit.si
  3851.     END
  3852.   END
  3853. IF writeopen(bbspath'USERS/'name)=0 THEN RETURN
  3854. IF data.0<24 THEN data.0=24
  3855. DO i=1 TO data.0
  3856.   CALL WRITELN(f,data.i)
  3857. END
  3858. CALL CLOSE(f)
  3859. SAY 'User' name 'has been updated.'
  3860. RETURN
  3861.  
  3862.  
  3863. loadData:
  3864. IF name='' THEN RETURN 0
  3865. IF ~readopen(bbspath'USERS/'name) THEN RETURN 0
  3866. data.=''
  3867. DO i=1
  3868.   line=READLN(f)
  3869.   IF EOF(f) THEN BREAK
  3870.   data.i=line
  3871. END
  3872. data.0=i-1
  3873. CALL CLOSE(f)
  3874. winnings=WORD(data.18,1)
  3875. IF ~DATATYPE(winnings,'N') THEN winnings=0
  3876.  
  3877. setData:
  3878. IF WORDS(data.16)<3 THEN data.16='0 19900101 00:00:00'
  3879. lastbrowse=WORD(data.16,1)
  3880. level=data.20
  3881. DO i=1 TO level
  3882.   lastread.i=WORD(data.22,i)
  3883.   IF ~DATATYPE(lastread.i,'N') THEN lastread.i=0
  3884.   totwrit.i=WORD(data.23,i)
  3885.   IF ~DATATYPE(totwrit.i,'N') THEN totwrit.i=0
  3886. END
  3887. password=data.5
  3888. IF FIND(UPPER(data.8),'TERSE')>0 THEN terseflag=1
  3889. ELSE terseflag=0
  3890. IF FIND(UPPER(data.8),'COLOR')>0 THEN colorflag=1
  3891. ELSE colorflag=0
  3892. CALL colors(colorflag)
  3893. menu='ALL'
  3894. IF FIND(UPPER(data.8),'MENUS')>0 THEN
  3895.   DO
  3896.     menuflag=1
  3897.     menu='MAIN'
  3898.   END
  3899. ELSE IF FIND(UPPER(data.8),'MENU')>0 THEN menuflag=1
  3900. ELSE menuflag=0
  3901. IF level=0 THEN menu='NEW'
  3902. data.21=UPPER(data.21)
  3903. maxtime=WORD(data.11,1)*60
  3904. RETURN 1
  3905.  
  3906.  
  3907. switchmenuflag:
  3908. IF menuflag=1 THEN
  3909.   DO
  3910.     menuflag=0
  3911.     noff='OFF'
  3912.   END
  3913. ELSE
  3914.   DO
  3915.     menuflag=1
  3916.     noff='ON'
  3917.   END
  3918. SAY 'Menus turned' pen3||noff||def'.'
  3919. SAY 'To make a permanent change, add or delete MENU(S) from [Y]our userdata item 8.'
  3920. RETURN
  3921.  
  3922.  
  3923. switchcolors:
  3924. IF colorflag=1 THEN
  3925.   DO
  3926.     colorflag=0
  3927.     noff='OFF'
  3928.   END
  3929. ELSE
  3930.   DO
  3931.     colorflag=1
  3932.     noff='ON'
  3933.   END
  3934. CALL colors(colorflag)
  3935. SAY 'Color turned' pen3||noff||def'.'
  3936. SAY 'To make a permanent change, add or delete COLOR from [Y]our userdata item 8.'
  3937. RETURN
  3938.  
  3939.  
  3940. /* ANSI pen color codes */
  3941. colors:
  3942. ARG onoff
  3943. IF onoff THEN
  3944.   DO
  3945.     lineup='1B'x'M'
  3946.     def='';  /* default */
  3947.     pen0='';  pen1='';  pen2='';  pen3=''
  3948.     pen4='';  pen5='';  pen6='';  pen7=''
  3949.     bak0='';  bak1='';  bak2='';  bak3=''
  3950.     bak4='';  bak5='';  bak6='';  bak7=''
  3951.   END
  3952. ELSE
  3953.   DO
  3954.     pen0=''; pen1=''; pen2=''; pen3=''; pen4=''; pen5=''; pen6=''; pen7=''
  3955.     bak0=''; bak1=''; bak2=''; bak3=''; bak4=''; bak5=''; bak6=''; bak7=''
  3956.     def='';  lineup=''
  3957.   END
  3958. RETURN
  3959.  
  3960.  
  3961. sortinfofiles:
  3962. infolist=SHOWDIR(bbspath'Information')
  3963. IF infolist='' THEN
  3964.   DO
  3965.     SAY 
  3966.     SAY pen3'No files are currently in the Information drawer.'def
  3967.     SAY 
  3968.     RETURN 1
  3969.   END
  3970. IF ~DATATYPE(sortinfo.0,'N') THEN
  3971.   DO
  3972.     info.=''
  3973.     sortinfo.=''
  3974.     info.0=WORDS(infolist)
  3975.     DO i=1 TO info.0
  3976.       info.i=WORD(infolist,i)
  3977.     END
  3978.     SAY 'Sorting..'
  3979.     CALL QSORT(1,info.0,info)
  3980.     sortinfo.0=info.0%3
  3981.     IF (info.0//3)>0 THEN sortinfo.0=sortinfo.0+1
  3982.     DO i=1 TO sortinfo.0
  3983.       sortinfo.i=''
  3984.       DO j=0 TO 2
  3985.         k=i+j*sortinfo.0
  3986.         IF k<=info.0 THEN
  3987.           DO
  3988.             sortinfo.i=sortinfo.i RIGHT(k,3)'.' LEFT(info.k,19)
  3989.             infocount=WORD(STATEF(bbspath'Information/'info.k),8)
  3990.             sortinfo.i.0=sortinfo.i.0||RIGHT(infocount,5) LEFT(info.k,19)
  3991.           END
  3992.       END
  3993.     END
  3994.     SAY lineup'         'lineup
  3995.   END
  3996. RETURN 0
  3997.  
  3998.  
  3999. information:
  4000. IF sortinfofiles() THEN RETURN
  4001. SAY pen3'These text files are available for reading online...'def
  4002. num=1
  4003. readcount=-1
  4004. DO infoloop=1
  4005.   IF num=0 THEN
  4006.     DO
  4007.       IF readcount~=-1 THEN
  4008.         DO
  4009.           sortinfo.0=''
  4010.           IF sortinfofiles() THEN RETURN
  4011.         END
  4012.       SAY CENTER('- Number of accesses per file -',75)
  4013.     END
  4014.   SAY pen3||LEFT('-',75,'-')||def
  4015.   IF num=0 THEN
  4016.     DO i=1 TO sortinfo.0
  4017.       SAY sortinfo.i.0
  4018.     END
  4019.   ELSE
  4020.     DO i=1 TO sortinfo.0
  4021.       SAY sortinfo.i
  4022.     END
  4023.   IF num=0 THEN
  4024.     DO
  4025.       CALL waiting()
  4026.       num=1
  4027.       ITERATE infoloop
  4028.     END
  4029.   num=getinput(1 0 pen3'Select Number Of Information File To View. 0=Stats > 'def)
  4030.   IF num=0 THEN ITERATE infoloop
  4031.   IF ~DATATYPE(num,'N') | num<1 | num>info.0 THEN RETURN
  4032.   readcount=STATEF(bbspath'Information/'info.num)
  4033.   readbytes=WORD(readcount,2)
  4034.   readcount=WORD(readcount,8)
  4035.   IF ~DATATYPE(readcount,'N') THEN readcount=0
  4036.   SAY '  'info.num 'is' readbytes 'bytes.'
  4037.   SAY 'Loading File...'
  4038.   ADDRESS COMMAND 'C:filenote' bbspath'Information/'info.num readcount+1
  4039.   CALL readlines(bbspath'Information/'info.num 1)
  4040.   CALL cleanline(0)
  4041.   SAY '    'lynes.0 'lines.'
  4042.   CALL seelines(0)
  4043.   IF waitchar~='Q' THEN CALL waiting()
  4044.   nonstop=0
  4045. END
  4046. RETURN
  4047.  
  4048.  
  4049. newfiles:
  4050. SAY 
  4051. test=''
  4052. test=getinput(1 1 'Show one library only? (Ny) > ')
  4053. IF test='Y' THEN
  4054.   IF chdir()>0 THEN RETURN
  4055. SAY 'Searching for new (un-browsed) files since' DATE(,WORD(data.16,2),'S') 'at' WORD(data.16,3)'...'
  4056. lastbrowz=WORD(data.16,1)
  4057. lastfileup=countcheck(bbspath'Numbers/LastFile' 0)
  4058. IF lastbrowz=lastfileup THEN
  4059.   DO
  4060.     lastbrowz=0
  4061.     SAY pen3'No new files. Listing backwards by date from last file uploaded...'def
  4062.   END
  4063. ELSE newfilesflag=1
  4064. j=0
  4065. IF test='Y' THEN filecount=WORDS(SHOWDIR(bbspath'FileNotes/'plaindir))
  4066. DO ni=lastfileup TO lastbrowz+1 BY -1
  4067.   IF files.ni~='' THEN
  4068.     DO
  4069.       IF test='Y' THEN 
  4070.         DO
  4071.           IF j>=filecount THEN LEAVE ni
  4072.           IF UPPER(LEFT(WORD(files.ni,1),12))~=UPPER(LEFT(plaindir,12)) THEN
  4073.             ITERATE ni
  4074.         END
  4075.       jj=files.ni.0
  4076.       IF WORD(alpha.jj,4)>level | FIND(data.21,UPPER(WORD(files.ni,1)))>0 THEN
  4077.         ITERATE ni  /* unauthorized */
  4078.       j=j+1
  4079.       IF j=1 THEN CALL fileheader()
  4080.       SAY LEFT(alpha.jj,76)
  4081.       IF (j+2)//(linesperpage-1)=0 THEN
  4082.         IF waiting2() THEN LEAVE ni
  4083.     END
  4084. END
  4085. IF j//linesperpage~=0 THEN CALL waiting()
  4086. IF test~='Y' THEN
  4087.   DO
  4088.     CALL newinfo()
  4089.     IF lynes.0>0 THEN CALL waiting()
  4090.   END
  4091. nonstop=0
  4092. RETURN
  4093.  
  4094.  
  4095. newinfo:
  4096. lynes.=''
  4097. lynes.0=0
  4098. dm=DATE(,WORD(data.16,2),'S')
  4099. PARSE VAR dm da' 'mo' 'yr .
  4100. yr=RIGHT(yr,2)
  4101. sincedate=da'-'mo'-'yr
  4102. startline=1
  4103. arg=bbspath'Information'
  4104. IF WORD(STATEF(arg),5)>lastondate THEN
  4105.   DO
  4106.     ADDRESS COMMAND 'C:LIST >ram:locdirlist' arg 'NOHEAD DATES SINCE' sincedate
  4107.     IF WORD(STATEF('ram:locdirlist'),2)>3 THEN
  4108.       DO
  4109.         lynes.startline=pen1||bak2' New or Updated Information Files. Enter'def pen3'I'def bak2'from the main menu to read 'def
  4110.         CALL readlines('ram:locdirlist' startline+1)
  4111.       END
  4112.   END
  4113. arg=bbspath'Profiles'
  4114. IF level>0 & WORD(STATEF(arg),5)>lastondate THEN
  4115.   DO
  4116.     ADDRESS COMMAND 'C:LIST >ram:locdirlist' arg 'NOHEAD DATES SINCE' sincedate
  4117.     IF WORD(STATEF('ram:locdirlist'),2)>3 THEN
  4118.       DO
  4119.         startline=lynes.0+2
  4120.         lynes.startline=pen1||bak2' New or Updated User Profiles. Enter'def pen3'&'def bak2'from the main menu to read 'def
  4121.         CALL readlines('ram:locdirlist' startline+1)
  4122.       END
  4123.   END
  4124. arg=bbspath'rexxDoors/Data/Polls'
  4125. IF level>0 & WORD(STATEF(arg),5)>lastondate THEN
  4126.   DO
  4127.     startline=lynes.0+2
  4128.     lynes.startline=pen1||bak2' Voting Activity. Enter'def pen3'J'def bak2'from the main menu, then select Polling_Place 'def
  4129.     lynes.0=startline
  4130.   END
  4131. IF logonflag=1 THEN nonstop=1
  4132. IF lynes.0>0 THEN CALL seelines(1)
  4133. nonstop=0
  4134. RETURN
  4135.  
  4136.  
  4137. areaselect:
  4138. SAY pen3||LEFT('-',75,'-')||def
  4139. DO i=1 TO msgs.0
  4140.   SAY msgs.i
  4141.   IF i//linesperpage=0 THEN CALL waiting()
  4142. END
  4143. temp=getinput(1 0 pen3'Select Message Conference: 'def)
  4144. IF ~DATATYPE(temp,'N') | temp<1 | temp>level | FIND(data.21,temp)>0 THEN RETURN 1
  4145. msgdir=temp
  4146. RETURN 0
  4147.  
  4148.  
  4149. chdir:
  4150. string=''
  4151. SAY pen3||LEFT('-',75,'-')||def
  4152. DO i=1 TO libs.0
  4153.   SAY libs.i
  4154. END
  4155. dirnum=getinput(1 0 pen3'Select Library Number: 'def)
  4156. IF ~DATATYPE(dirnum,'N') THEN
  4157.   DO
  4158.     waitchar=dirnum
  4159.     RETURN 2
  4160.   END
  4161.  
  4162. chdir2:
  4163. IF dirnum<1 | dirnum>99 THEN
  4164.   DO
  4165.     waitchar=dirnum
  4166.     RETURN 1
  4167.   END
  4168. IF dirs.dirnum='' THEN
  4169.   DO
  4170.     SAY pen3'That library number is currently un-assigned.'def
  4171.     RETURN 1
  4172.   END
  4173. IF dirnum>level | FIND(data.21,UPPER(dirs.dirnum))>0 THEN
  4174.   DO
  4175.     SAY pen3'You do not have authorization for that library!'def
  4176.     RETURN 1
  4177.   END
  4178. IF dirs.dirnum~='' THEN
  4179.   DO
  4180.     CALL MAKEDIR(libpath||dirs.dirnum)
  4181.     CALL setdir(libpath||dirs.dirnum)
  4182.   END
  4183. RETURN 0
  4184.  
  4185.  
  4186. since:
  4187. dm=DATE(,WORD(data.16,2),'S')
  4188. SAY 
  4189. SAY 'New files or files moved since' dm
  4190. CALL listsince()
  4191. CALL readlines('ram:locdirlist' 1)
  4192. CALL seelines(1)
  4193. nonstop=0
  4194. CALL waiting()
  4195. RETURN
  4196.  
  4197.  
  4198. listsince:
  4199. dm=DATE(,WORD(data.16,2),'S')
  4200. PARSE VAR dm da' 'mo' 'yr .
  4201. yr=RIGHT(yr,2)
  4202. sincedate=da'-'mo'-'yr
  4203. ADDRESS COMMAND 'C:list >ram:locdirlist' directory 'DATES SINCE' sincedate
  4204. RETURN
  4205.  
  4206.  
  4207. list:
  4208. onetime=0
  4209. IF DATATYPE(arg,'N') THEN onetime=1
  4210. ELSE arg=''
  4211. DO listloop=1
  4212.   IF DATATYPE(arg,'N') THEN
  4213.     DO
  4214.       dirnum=arg
  4215.       arg=''
  4216.       IF chdir2()>0 THEN RETURN
  4217.       CALL listsimple()
  4218.       IF waitchar='Q' THEN RETURN
  4219.       IF onetime THEN LEAVE listloop
  4220.     END
  4221.   ELSE IF arg='' THEN
  4222.     DO
  4223.       IF chdir()>0 THEN RETURN
  4224.       test='Y'
  4225.       CALL showalpha2()
  4226.       arg=''
  4227.       ITERATE listloop
  4228.     END
  4229.   ELSE RETURN
  4230. END
  4231. RETURN
  4232.  
  4233.  
  4234. listsimple:
  4235. ADDRESS COMMAND 'C:list >ram:locdirlist' directory 'DATES'
  4236. IF readlines('ram:locdirlist' 1) THEN RETURN
  4237. IF lynes.0>3 THEN
  4238.   DO
  4239.     SAY pen3'Sorting...'def||lineup
  4240.     linesave=lynes.1  /* these 4 lines put in to leave dir title at top */
  4241.     lynes.1='0'
  4242.     CALL QSORT(1,lynes.0-1,lynes)
  4243.     CALL DELAY(14)
  4244.     lynes.1=linesave
  4245.   END
  4246. CALL seelines(1)
  4247. nonstop=0
  4248. CALL waiting()
  4249. RETURN
  4250.  
  4251.  
  4252. browse:
  4253. curdironly=0
  4254. brdir=PRAGMA('D')
  4255. brfilenum=1
  4256. nonstop=0
  4257. IF files.0<1 THEN RETURN
  4258. lastfilenum=countcheck(bbspath'Numbers/LastFile' 0)
  4259. IF lastfilenum<1 THEN RETURN
  4260. IF arg='' THEN
  4261.   DO
  4262.     test=getinput(1 1 '['pen3'R'def']ead descriptions or ['pen3'A'def']rchive for later download. (aR) > ')
  4263.     IF test='A' THEN
  4264.       DO
  4265.         IF STORAGE()<(bbsprefs.15+100000) THEN
  4266.           DO
  4267.             SAY
  4268.             SAY 'Sorry! Not enough memory left for background archiving.'
  4269.             SAY 'Please try again in 10 minutes or so.'
  4270.             SAY
  4271.             RETURN
  4272.           END
  4273.         CALL Make_BrowseList.baud(name)
  4274.         IF countcheck(bbspath'Numbers/LastFile' 0)>lastfilenum THEN
  4275.           IF emailonline>=0 THEN emailonline=emailonline+1
  4276.         RETURN
  4277.       END
  4278.     line='Browsing'
  4279.     test=getinput(1 1 'Browse one library only? (Ny) > ')
  4280.     IF test='Y' THEN
  4281.       DO
  4282.         IF chdir()>0 THEN RETURN
  4283.         curdironly=1
  4284.         line=line 'the' pen3||plaindir||def 'library'
  4285.       END
  4286.     ELSE line=line 'all file libraries'
  4287.     line=line 'backwards from latest file.'
  4288.     SAY line
  4289.   END
  4290. i=0
  4291. IF arg='' | UPPER(arg)='NEW' | UPPER(arg)='ALL' THEN
  4292.   DO lastfileloop=1
  4293.     IF lastfilenum<1 THEN RETURN
  4294.     arg=WORD(files.lastfilenum,2)
  4295.     brfilenum=lastfilenum
  4296.     IF WORD(files.lastfilenum,2)~='' THEN LEAVE lastfileloop
  4297.     lastfilenum=lastfilenum-1
  4298.   END
  4299. ELSE IF DATATYPE(arg,'N') & files.arg~='' THEN
  4300.   DO
  4301.     brfilenum=arg
  4302.     arg=WORD(files.arg,2)
  4303.   END
  4304. ELSE
  4305.   DO
  4306.     DO i=1 TO lastfilenum+1
  4307.       IF UPPER(WORD(files.i,2))~=UPPER(arg) THEN ITERATE i
  4308.       brfilenum=i
  4309.       LEAVE i
  4310.     END
  4311.     IF i>lastfilenum THEN
  4312.       DO
  4313.         SAY 'Unable to find a file description for' pen3||arg||def'.'
  4314.         RETURN
  4315.       END
  4316.   END
  4317. IF ~curdironly THEN CALL setdir(libpath||WORD(files.brfilenum,1))
  4318. savearg=arg
  4319. IF brfilenum>lastfilenum THEN brfilenum=lastfilenum
  4320. newfilesdate=DATE('S') TIME()
  4321. DO browseloop=1
  4322.   DO i=brfilenum TO 0 BY -1
  4323.     IF files.i='' THEN ITERATE i
  4324.     testdir=UPPER(WORD(files.i,1))
  4325.     IF curdironly & UPPER(plaindir)~=UPPER(testdir) THEN
  4326.       DO
  4327.         IF i>lastbrowse THEN lastbrowse=i
  4328.         ITERATE i
  4329.       END
  4330.     IF FIND(data.21,testdir)>0 | finddirnum(testdir)>level THEN
  4331.       DO
  4332.         IF i>lastbrowse THEN lastbrowse=i
  4333.         ITERATE i
  4334.       END
  4335.     LEAVE i
  4336.   END
  4337.   IF i=0 THEN brfilenum=lastbrowse
  4338.   ELSE brfilenum=i
  4339.   argname=WORD(files.brfilenum,2)
  4340.   IF argname='' THEN RETURN
  4341.   CALL setdir(libpath||WORD(files.i,1))
  4342.   arg=bbspath'FileNotes/'plaindir'/'argname
  4343.   CALL readlines(arg 1)
  4344.   IF nonstop=1 THEN brostop=1
  4345.   ELSE brostop=0
  4346.   CALL seelines(1)
  4347.   IF brfilenum>lastbrowse THEN lastbrowse=brfilenum
  4348.   IF brostop THEN
  4349.     DO
  4350.       SAY
  4351.       nonstop=1
  4352.       brfilenum=brfilenum-1
  4353.     END
  4354.   ELSE
  4355.     DO
  4356.       line=''
  4357.       endtest=UPPER(RIGHT(argname,4))
  4358.       IF FIND('.ARC .DMS .LZH .LHA .RUN .ZIP .ZOO',endtest)>0 THEN
  4359.         line='['pen3'C'def']ontents ['pen3'D'def']ownload'
  4360.       ELSE line='['pen3'D'def']ownload'
  4361.       IF level>sysoplevel | name=WORD(lynes.3,2) THEN
  4362.         line=line '['pen3'E'def']dit'
  4363.       IF level>sysoplevel | name=WORD(lynes.3,2) THEN
  4364.         line=line '['pen3'K'def']ill'
  4365.       IF level>sysoplevel THEN line=line '['pen3'L'def']ib'
  4366.       line=line '['pen3'M'def']ark ['pen3'N'def']on-Stop'
  4367.       IF endtest='.TXT' THEN line=line '['pen3'R'def']ead'
  4368.       line=line '['pen3'Q'def']uit ['pen3'?'def'] > '
  4369.       brcom=getinput(1 0 line)
  4370.       IF DATATYPE(brcom,'N') THEN
  4371.         DO
  4372.           brfilenum=brcom+1
  4373.           IF brfilenum>lastfilenum THEN brfilenum=lastfilenum+1
  4374.           IF brfilenum<1 THEN brfilenum=1
  4375.           SAY
  4376.         END
  4377.       ELSE brcom=LEFT(brcom,1)
  4378.       CALL cleanline(0)
  4379.       IF brcom='Q' THEN LEAVE browseloop
  4380.       IF brcom='M' THEN
  4381.         DO
  4382.           wordnum=FIND(data.25,brfilenum)
  4383.           IF wordnum=0 THEN
  4384.             DO
  4385.               data.25=STRIP(data.25 brfilenum)
  4386.               SAY lineup||argname 'marked for next download.'
  4387.               SAY
  4388.             END
  4389.           ELSE
  4390.             DO
  4391.               data.25=STRIP(DELWORD(data.25,wordnum,1))
  4392.               SAY argname 'removed from download list.'
  4393.             END
  4394.         END
  4395.       IF brcom='H' | brcom='?' THEN
  4396.         DO
  4397.           SAY pen3' - HELP with the Browse Files commands -'def
  4398.           SAY ' RETURN reads the next file description in line.'
  4399.           SAY ' 34 will display the description of file number 34, if it exists.'
  4400.           SAY ' C  displays the contents of an archived (arc dms lzh lha zip zoo) file.'
  4401.           SAY ' D  displays the download menu.'
  4402.           IF level>sysoplevel | name=WORD(lynes.3,2) THEN
  4403.             DO
  4404.           SAY ' E  puts this file description into the online Editor.'
  4405.           SAY ' K  deletes a file you uploaded. you cannot Kill others!'
  4406.             END
  4407.           IF level>sysoplevel THEN
  4408.           SAY ' L  move file and description to new Library and/or rename.'
  4409.           SAY ' M  mark/unmark the current file for the next download'
  4410.           SAY ' N  displays all descriptions without pausing. CTRL-E to Exit!'
  4411.           SAY ' R  displays file as text. - ONLY FILES THAT END IN .TXT -'
  4412.           SAY ' Q  returns to the main menu(s). (Quit)'
  4413.           SAY
  4414.           CALL waiting()
  4415.           IF waitchar='Q' THEN LEAVE browseloop
  4416.         END
  4417.       ELSE IF brcom='L' & level>sysoplevel THEN
  4418.         DO
  4419.           curdir=PRAGMA('D')
  4420.           IF getinput(1 1 'Rename' argname '? (Ny) > ')='Y' THEN
  4421.             DO
  4422.               newarg=getinput(0 0 'Rename' argname 'to ')
  4423.               IF newarg~='' THEN
  4424.                 DO
  4425.                   junk=getinput(1 1 'Are you SURE you want to rename' argname 'to' newarg'? (Ny) ')
  4426.                   IF junk='Y' THEN
  4427.                     DO
  4428.                       lynes.2=OVERLAY(newarg,lynes.2,7,25)
  4429.                       comment=WORD(STATEF(libpath||filedir'/'arg),8)
  4430.                       CALL DELETE(arg)
  4431.                       CALL savelines(arg)
  4432.                       mpath=bbspath'FileNotes/'plaindir
  4433.                       CALL RENAME(mpath'/'argname,mpath'/'newarg)
  4434.                       IF comment~='' THEN
  4435.                         ADDRESS COMMAND 'C:FileNote' mpath'/'newarg comment
  4436.                       mpath=libpath||plaindir
  4437.                       CALL RENAME(mpath'/'argname,mpath'/'newarg)
  4438.                       files.brfilenum=STRIP(WORD(files.brfilenum,1)) newarg
  4439.                       anum=files.brfilenum.0
  4440.                       alpha.anum=OVERLAY(newarg,alpha.anum,1,WORDINDEX(alpha.anum,2)-2)
  4441.                       argname=newarg
  4442.                       sortalphaflag=1
  4443.                       savefileflag=1
  4444.                     END
  4445.                 END
  4446.             END
  4447.           mvdir=getinput(0 0 'Move' argname 'to Library (name|number) ')
  4448.           IF mvdir~='' THEN
  4449.             DO
  4450.               IF DATATYPE(mvdir,'N') THEN
  4451.                 DO
  4452.                   dirnum=mvdir
  4453.                   IF chdir2()=0 THEN
  4454.                     CALL movefile(brfilenum dirs.dirnum)
  4455.                 END
  4456.               ELSE
  4457.                 DO
  4458.                   mvdir=STRIP(mvdir)
  4459.                   DO mj=1 TO level+1
  4460.                     IF UPPER(mvdir)=UPPER(dirs.mj) THEN LEAVE mj
  4461.                   END
  4462.                   IF mj<=level THEN CALL movefile(brfilenum mvdir)
  4463.                 END
  4464.             END
  4465.           IF savefileflag>0 THEN CALL savefilelist()
  4466.           CALL setdir(curdir)
  4467.         END
  4468.       ELSE IF brcom='N' THEN
  4469.         DO
  4470.           brfilenum=brfilenum-1
  4471.           nonstop=1
  4472.           SAY pen3'To EXIT non-stop scrolling of text, press CTRL-E'def
  4473.           SAY
  4474.           CALL DELAY(100)
  4475.           brcom=''
  4476.         END
  4477.       ELSE IF brcom='C' THEN
  4478.         DO
  4479.           temp=STRIP(WORD(STATEF(arg),8))
  4480.           IF temp='' THEN temp=libpath||plaindir'/'argname
  4481.           CALL Contents.rexx(temp)
  4482.           IF EXISTS('RAM:CONTENTS') THEN
  4483.             DO
  4484.               CALL readlines('RAM:CONTENTS' 1)
  4485.               CALL seelines(0)
  4486.               IF waitchar~='Q' THEN CALL waiting()
  4487.               nonstop=0
  4488.             END
  4489.           ELSE SAY pen3'Not an archived file.'def
  4490.         END
  4491.       ELSE IF brcom='D' THEN
  4492.         DO
  4493.           arg2=arg
  4494.           arg=argname
  4495.           CALL dload()
  4496.           arg=arg2
  4497.         END
  4498.       ELSE IF brcom='E' THEN
  4499.         DO
  4500.           IF level>sysoplevel | name=WORD(lynes.3,2) THEN
  4501.             DO
  4502.               firstedit=5
  4503.               IF level>sysoplevel THEN firstedit=1
  4504.               CALL bbsED(firstedit arg)
  4505.             END
  4506.         END
  4507.       ELSE IF brcom='K' THEN
  4508.         DO
  4509.           IF level>sysoplevel | name=WORD(lynes.3,2) THEN
  4510.             DO
  4511.               IF getinput(1 1 pen3'Do you really want to kill this file? (nY) >'def)~='N' THEN
  4512.                 DO
  4513.                   tempnum=WORD(lynes.1,2)
  4514.                   IF tempnum=lastfilenum THEN
  4515.                     DO
  4516.                       CALL DELETE(bbspath'Numbers/LastFile')
  4517.                       CALL DELAY(28)
  4518.                       lastfilenum=lastfilenum-1
  4519.                       CALL countcheck(bbspath'Numbers/LastFile' lastfilenum)
  4520.                     END
  4521.                   files.tempnum=''
  4522.                   tempnum2=files.tempnum.0
  4523.                   alpha.tempnum2='0 0' tempnum '100'
  4524.                   CALL savefilelist()
  4525.                   CALL DELETE(argname)
  4526.                   CALL DELETE(arg)
  4527.                   SAY argname pen3'has been deleted.'def
  4528.                 END
  4529.             END
  4530.         END
  4531.       ELSE IF brcom='R' & endtest='.TXT' THEN
  4532.         DO
  4533.           vcount=WORD(lynes.2,7)+1
  4534.           lynes.2=STRIP(DELWORD(lynes.2,7)) vcount
  4535.           edtype=''
  4536.           CALL savelines(arg)
  4537.           CALL showtext(argname)
  4538.         END
  4539.       ELSE brfilenum=brfilenum-1
  4540.     END
  4541. END
  4542. CALL setdir(brdir)
  4543. waitchar=''
  4544. IF nonstop THEN CALL waiting()
  4545. nonstop=0
  4546. CALL savedata(0)
  4547. RETURN
  4548.  
  4549.  
  4550. movefile:
  4551. PARSE ARG fnum movdir .
  4552. fromdir=STRIP(WORD(files.fnum,1))
  4553. farg=STRIP(WORD(files.fnum,2))
  4554. CALL MAKEDIR(libpath||movdir)
  4555. ADDRESS COMMAND 'C:COPY' libpath||fromdir'/'farg libpath||movdir
  4556. IF EXISTS(libpath||movdir'/'farg) THEN CALL DELETE(libpath||fromdir'/'farg)
  4557. files.fnum=movdir farg
  4558. lynes.3=DELWORD(lynes.3,WORDS(lynes.3),1)
  4559. lynes.3=STRIP(lynes.3) movdir
  4560. CALL MAKEDIR(bbspath'FileNotes/'movdir)
  4561. CALL savelines(bbspath'FileNotes/'movdir'/'farg)
  4562. ndx=files.fnum.0
  4563. dnum=finddirnum(movdir)
  4564. alpha.ndx=OVERLAY(RIGHT(dnum,2) movdir,alpha.ndx,31,15)
  4565. IF EXISTS(bbspath'FileNotes/'movdir'/'farg) THEN
  4566.   CALL DELETE(bbspath'FileNotes/'fromdir'/'farg)
  4567. savefileflag=1
  4568. line='Moved:' fromdir'/'farg 'to' movdir
  4569. SAY line
  4570. RETURN
  4571.  
  4572.  
  4573. textsearch:
  4574. PARSE ARG sfile' 'sarg
  4575. IF sarg='' THEN RETURN 0
  4576. x=OPEN(f,sfile,'R')
  4577. IF x=0 THEN RETURN 0
  4578. sarg=UPPER(sarg)
  4579. stemp=UPPER(READCH(f,65000))
  4580. CALL CLOSE(f)
  4581. retflag=0
  4582. IF POS(sarg,stemp)>0 THEN retflag=1
  4583. DROP stemp
  4584. RETURN retflag
  4585.  
  4586.  
  4587. bbsSEARCH:
  4588. smenu=menu
  4589. test=UPPER(LEFT(arg,1))
  4590. IF test='F' THEN smenu='FILE'
  4591. IF test='M' THEN smenu='MSG'
  4592. IF test='U' THEN smenu='MAIN'
  4593. IF smenu='ALL' THEN
  4594.   DO
  4595.     junk=getinput(1 1 'Search ['pen3'F'def']iles ['pen3'M'def']essages or ['pen3'U'def']sers (fmu) > ')
  4596.     IF junk='F' THEN smenu='FILE'
  4597.     ELSE IF junk='M' THEN smenu='MSG'
  4598.     ELSE IF junk='U' THEN smenu='MAIN'
  4599.     ELSE RETURN
  4600.   END
  4601. IF WORDS(arg)>1 THEN searcharg=UPPER(SUBSTR(arg,WORDINDEX(arg,2)))
  4602. ELSE searcharg=getinput(0 0 pen3'Search Phrase: 'def)
  4603. IF LENGTH(STRIP(searcharg))=0 THEN RETURN
  4604. searcharg=COMPRESS(searcharg,'*')
  4605. IF smenu='NEW' | smenu='MAIN' THEN
  4606.   DO
  4607.     SAY 'Searching Userlist...'
  4608.     DO i=1 TO WORDS(userlist)
  4609.       IF POS(UPPER(searcharg),UPPER(WORD(userlist,i)))>0 THEN
  4610.         SAY WORD(userlist,i)
  4611.     END
  4612.   END
  4613. IF smenu='MSG' THEN
  4614.   DO
  4615.     SAY 'Searching Message Conferences for'pen3 searcharg||def'...'
  4616.     SAY
  4617.     DO msgdir=1 TO level
  4618.       IF msg.msgdir='' | FIND(data.21,msgdir)>0 THEN ITERATE msgdir
  4619.       CALL searchmsgdir()
  4620.       IF msgcom='Q' THEN LEAVE msgdir
  4621.     END
  4622.   END
  4623. IF smenu='FILE' THEN
  4624.   DO
  4625.     SAY pen3'WARNING!'def 'Searching' files.0 '['pen3'F'def']ull descriptions may take'pen3 TRUNC(files.0/(114*cpu)+.05,1) def'minutes!'
  4626.     test=getinput(1 1 ' ['pen3'A'def']lphaList search or ['pen3'F'def']ull descriptions? (Afq) > ')
  4627.     IF test='Q' THEN RETURN
  4628.     IF test~='F' THEN
  4629.       DO
  4630.         SAY
  4631.         SAY pen3'Searching files for'def UPPER(searcharg)
  4632.         CALL fileheader()
  4633.         DO i=1 TO alpha.0
  4634.           IF WORD(alpha.i,4)>level THEN ITERATE i
  4635.           ii=WORD(alpha.i,3)
  4636.           IF POS(UPPER(WORD(files.ii,1)),data.21)>0 THEN ITERATE i
  4637.           tempnum=POS(UPPER(searcharg),UPPER(alpha.i))
  4638.           IF tempnum>0 THEN
  4639.             DO
  4640.               SAY alpha.i
  4641.               IF colorflag=1 THEN
  4642.                 SAY pen3||LEFT(' ',tempnum-1)||lineup||UPPER(searcharg)||def
  4643.             END
  4644.         END
  4645.       END
  4646.     ELSE
  4647.       DO
  4648.         SAY
  4649.         SAY pen3'Searching files for'def UPPER(searcharg)
  4650.         SAY pen3' - To ABORT, press CTRL-E -'def
  4651.         SAY
  4652.         cck=countcheck(bbspath'Numbers/LastFile' 0)
  4653.         nonstop=1
  4654.         DO i=1 TO cck
  4655.           iii=cck+1-i
  4656.           IF files.iii='' THEN ITERATE i
  4657.           farg=WORD(files.iii,1)'/'WORD(files.iii,2)
  4658.           ii=files.iii.0
  4659.           IF WORD(alpha.ii,4)>level THEN ITERATE i
  4660.           IF POS(UPPER(WORD(files.iii,1)),data.21)>0 THEN ITERATE i
  4661.           SAY '1B'x'M' RIGHT(farg,40) LEFT(iii,7)
  4662.           IF textsearch(bbspath'FileNotes/'farg searcharg) THEN
  4663.             DO
  4664.               savei=i
  4665.               CALL readlines(bbspath'FileNotes/'farg 1)
  4666.               CALL seelines(2)
  4667.               i=savei
  4668.               SAY
  4669.               SAY
  4670.             END
  4671.         END
  4672.       END
  4673.   END
  4674. searcharg=''
  4675. nonstop=0
  4676. CALL waiting()
  4677. RETURN
  4678.  
  4679.  
  4680. searchmsgdir:
  4681. msglist=SHOWDIR(msgpath||msgdir)
  4682. IF WORDS(msglist)>0 THEN SAY lineup||RIGHT(msg.msgdir,40)
  4683. DO sri=1 TO WORDS(msglist)
  4684.   messnum=WORD(msglist,sri)%1
  4685.   IF textsearch(msgpath||msgdir'/'messnum searcharg) THEN
  4686.     DO
  4687.       savelast=lastread.msgdir
  4688.       CALL readmsg(0 messnum)
  4689.       lastread.msgdir=savelast
  4690.       IF msgcom='Q' THEN RETURN
  4691.     END
  4692. END
  4693. RETURN
  4694.  
  4695.  
  4696. finddirnum:
  4697. ARG fdirname .
  4698. DO fdir=1 TO 99
  4699.   IF UPPER(dirs.fdir)=UPPER(fdirname) THEN RETURN fdir
  4700. END
  4701. RETURN 100
  4702.  
  4703.  
  4704. writebuffer:
  4705. PARSE ARG bufname .
  4706. CALL DELETE(bufname)
  4707. startnum=lynes.0+1
  4708. OPTIONS PROMPT ''
  4709. SAY pen3'LOCAL logon! Input cannot exceed 250 characters per line!'def
  4710. SAY 'Type 'pen3'/E'def'nd on a new line to exit and' pen3'DO YOUR OWN WORDWRAP!'def
  4711. DO bufloop=startnum
  4712.   PARSE PULL line
  4713.   IF LEFT(UPPER(STRIP(line)),2)='/E' | LEFT(UPPER(STRIP(line)),2)='/S' THEN
  4714.     LEAVE bufloop
  4715.   lynes.bufloop=line
  4716. END
  4717. lynes.0=bufloop-1
  4718. CALL wrapbuf(startnum)
  4719. CALL DELETE(bufname)     /* these 4 lines make wordwrap more consistent */
  4720. CALL savelines(bufname)
  4721. CALL readlines(bufname 1)
  4722. CALL wrapbuf(startnum)
  4723. RETURN
  4724.  
  4725.  
  4726. wrapbuf:
  4727. ARG startnum .
  4728. CALL cleanline(1)
  4729. SAY pen3'Wordwrapping...'def
  4730. lynes.startnum=TRANSLATE(lynes.startnum,' ','09'x)
  4731. lynes.startnum=COMPRESS(lynes.startnum,'0C'x)  /* no FF */
  4732. DO wi=startnum WHILE wi<=lynes.0
  4733.   wj=wi+1
  4734.   lynes.wj=COMPRESS(lynes.wj,'08'x||'0C'x||'7F'x)
  4735.   tabpos=POS('09'x,lynes.wi)
  4736.   DO WHILE tabpos>0
  4737.     lynes.wi=DELSTR(lynes.wi,tabpos,1)
  4738.     lynes.wi=INSERT('  ',lynes.wi,tabpos-1)
  4739.     tabpos=POS('09'x,lynes.wi)
  4740.   END
  4741.   IF LENGTH(lynes.wi)>75 THEN
  4742.     DO
  4743.       testchar=''
  4744.       IF lynes.wj~='' THEN testchar=LEFT(lynes.wj,1)
  4745.       IF testchar=' ' | testchar='.' | testchar=':' THEN
  4746.         DO
  4747.           DO wjj=lynes.0 TO wi+1 BY -1
  4748.             wk=wjj+1
  4749.             lynes.wk=lynes.wjj
  4750.           END
  4751.           lynes.wj=''
  4752.           lynes.0=lynes.0+1
  4753.         END
  4754.       DO wl=WORDS(lynes.wi) TO 1 BY -1 WHILE LENGTH(lynes.wi)>74
  4755.         IF WORDS(lynes.wi)=1 THEN
  4756.           lynes.wi=LEFT(lynes.wi,74) SUBSTR(lynes.wi,75)
  4757.         lynes.wj=WORD(lynes.wi,wl) lynes.wj
  4758.         lynes.wi=STRIP(DELWORD(lynes.wi,wl,1))
  4759.       END
  4760.     END
  4761. END
  4762. RETURN
  4763.  
  4764.  
  4765. seelines:
  4766. ARG fancy .
  4767. DO i=1 TO lynes.0
  4768.   IF fancy=0 THEN SAY lynes.i||def
  4769.   ELSE
  4770.     DO
  4771.       IF LEFT(lynes.i,2)=': ' & WORDS(lynes.i)=2 THEN ITERATE i
  4772.       ELSE IF LEFT(lynes.i,10)='Directory ' | LEFT(lynes.i,5)='=====' THEN
  4773.         SAY pen3||lynes.i||def
  4774.       ELSE SAY lynes.i
  4775.       IF fancy=2 & colorflag=1 & searcharg~='' THEN
  4776.         DO
  4777.           testpos=POS(UPPER(searcharg),UPPER(lynes.i))
  4778.           IF testpos>0 THEN
  4779.             SAY LEFT(' ',testpos-1)||pen3||lineup||UPPER(searcharg)||def
  4780.         END
  4781.     END
  4782.   IF i//linesperpage=0 THEN
  4783.     IF waiting2() THEN LEAVE i
  4784. END
  4785. nonstop=0
  4786. RETURN
  4787.  
  4788.  
  4789. readlines:
  4790. CALL CLOSE(f)
  4791. PARSE ARG tempname readstart .
  4792. IF ~readopen(tempname) THEN RETURN 1
  4793. IF readstart<2 THEN lynes.=''
  4794. DO ri=readstart
  4795.   line=READLN(f)
  4796.   IF EOF(f) THEN BREAK
  4797.   lynes.ri=line
  4798. END
  4799. lynes.0=ri-1
  4800. CALL CLOSE(f)
  4801. DO ri=lynes.0 TO 0 BY -1 WHILE LENGTH(lynes.ri)=0 | UPPER(lynes.ri)='/END' | UPPER(lynes.ri)='/S'
  4802. END
  4803. lynes.0=ri
  4804. RETURN 0
  4805.  
  4806.  
  4807. savelines:
  4808. PARSE ARG tempname .
  4809. IF EXISTS(tempname) & edtype='MAIL' THEN
  4810.   DO
  4811.     ok=OPEN(f,tempname,'A')
  4812.     IF ok~=0 THEN CALL WRITELN(f,INSERT('','',1,74,'^'))
  4813.   END
  4814. ELSE ok=OPEN(f,tempname,'W')
  4815. IF ok=0 THEN
  4816.   DO
  4817.     line='***' tempname 'failed to open for saving!'
  4818.     SAY line
  4819.     RETURN 1
  4820.   END
  4821. DO wi=1 TO lynes.0
  4822.   CALL WRITELN(f,lynes.wi)
  4823. END
  4824. CALL CLOSE(f)
  4825. RETURN 0
  4826.  
  4827.  
  4828. loaduserlist:
  4829. userlist=SHOWDIR(bbspath'Users')
  4830. ulynes.=''
  4831. IF ~EXISTS(bbspath'Lists/USERS') THEN CALL sortuserlist()
  4832. ELSE IF readopen(bbspath'Lists/USERS') THEN
  4833.   DO
  4834.     SAY 'Loading Userlist...'
  4835.     DO lui=1
  4836.       line=READLN(f)
  4837.       IF EOF(f) THEN BREAK
  4838.       ulynes.lui=line
  4839.     END
  4840.     ulynes.0=lui-1
  4841.     CALL CLOSE(f)
  4842.   END
  4843. RETURN
  4844.  
  4845.  
  4846. saveuserlist:
  4847. SIGNAL OFF BREAK_E
  4848. IF writeopen(bbspath'Lists/USERS') THEN
  4849.   DO
  4850.     DO i=1 TO ulynes.0
  4851.       CALL WRITELN(f,ulynes.i)
  4852.     END
  4853.     CALL CLOSE(f)
  4854.   END
  4855. RETURN
  4856.  
  4857.  
  4858. sortuserlist:
  4859. SAY 'Rebuilding Userlist...'
  4860. userlist=SHOWDIR(bbspath'Users')
  4861. user.=''
  4862. users=WORDS(userlist)
  4863. user.0=users
  4864. DO uli=1 TO users
  4865.   user.uli=WORD(userlist,uli)
  4866.   uscore=LASTPOS('_',user.uli)
  4867.   IF uscore>0 THEN user.uli=SUBSTR(user.uli,uscore+1)'@'LEFT(user.uli,uscore-1)
  4868. END
  4869. CALL QSORT(1,users,user)
  4870. DO uli=1 TO users
  4871.   uscore=POS('@',user.uli)
  4872.   IF uscore>0 THEN user.uli=SUBSTR(user.uli,uscore+1)'_'LEFT(user.uli,uscore-1)
  4873. END
  4874. ulynes.=''
  4875. ulynes.0=user.0%3
  4876. IF (user.0//3)>0 THEN ulynes.0=ulynes.0+1
  4877. DO i=1 TO ulynes.0
  4878.   ulynes.i=LEFT(user.i,25)
  4879.   DO j=1 TO 2
  4880.     k=i+j*ulynes.0
  4881.     IF k<=users THEN ulynes.i=ulynes.i' 'LEFT(user.k,25)
  4882.   END
  4883. END
  4884. CALL saveuserlist()
  4885. RETURN
  4886.  
  4887.  
  4888. showuserlist:
  4889. IF data.5='' THEN line='Here are the EMail names of your fellow users.'
  4890. ELSE line='   'WORDS(userlist) 'users. Use these names to address messages.'
  4891. SAY pen3||line||def
  4892. DO uli=1 TO ulynes.0
  4893.   SAY ulynes.uli
  4894.   IF uli//linesperpage=0 & uli<ulynes.0 THEN
  4895.     IF waiting2()=1 THEN RETURN
  4896. END
  4897. IF data.5~='' THEN CALL waiting()
  4898. RETURN
  4899.  
  4900.  
  4901. msgcount:
  4902. ARG countdir .
  4903. lastmess=0
  4904. totmsgs=0
  4905. unred=0
  4906. IF ~EXISTS(msgpath||countdir) THEN RETURN
  4907. IF STATEF(msgpath||countdir)=msg.countdir.1 THEN totmsgs=msg.countdir.0
  4908. ELSE
  4909.   DO
  4910.     totmsgs=WORDS(SHOWDIR(msgpath||countdir))
  4911.     msg.countdir.0=totmsgs
  4912.     msg.countdir.1=STATEF(msgpath||countdir)
  4913.   END
  4914. IF countdir>level | FIND(data.21,i)>0 THEN RETURN
  4915. lastread.countdir=WORD(data.22,countdir)
  4916. IF ~DATATYPE(lastread.countdir,'N') THEN lastread.countdir=0
  4917. lastmess=countcheck(bbspath'Numbers/LastMessage'countdir 0)
  4918. IF lastread.countdir<0 THEN RETURN
  4919. firstmess=countcheck(bbspath'Numbers/FirstMessage'countdir 0)
  4920. IF lastread.countdir<firstmess THEN lastread.countdir=firstmess-1
  4921. IF lastmess>0 THEN
  4922.   IF lastread.countdir>=0 THEN
  4923.     DO
  4924.       IF lastread.countdir<(firstmess-1) THEN lastread.countdir=firstmess-1
  4925.       unred=lastmess-lastread.countdir
  4926.       IF unred>totmsgs THEN unred=totmsgs
  4927.       cline=RIGHT(unred,6) 'unread of' RIGHT(lastmess,6)
  4928.       cline=cline 'messages in the 'CENTER(msg.countdir,20)' conference.'
  4929.       IF unred>0 | ~logonflag THEN SAY pen6||cline||def
  4930.     END
  4931. RETURN
  4932.  
  4933.  
  4934. counts:
  4935. SAY
  4936. DO i=1 TO 4
  4937.   SAY CENTER(copyright.i,75)
  4938. END
  4939. prevcaller=GETCLIP('BBS_prevcaller')
  4940. IF prevcaller~='' THEN
  4941.   DO
  4942.     SAY
  4943.     SAY 'The previous'pen3 bbsname def'user was:'
  4944.     SAY ' 'prevcaller
  4945.     SAY '  logged off at:' GETCLIP('BBS_userlogoff')
  4946.     SAY pen3'Last disconnect:'def GETCLIP('BBS_disconnect')
  4947.   END
  4948. SAY
  4949. day1='01'
  4950. IF readopen(bbspath'Numbers/FirstLogon') THEN
  4951.   DO
  4952.     line=READLN(f)
  4953.     CALL CLOSE(f)
  4954.     SAY 'The First Logon to'pen3 bbsname def'was' line'.'
  4955.     PARSE VAR line .' 'day1'-'.
  4956.   END
  4957. IF day1<10 & LENGTH(day1)<2 THEN day1='0'day1
  4958. SAY '     Your sysop is' pen3||sysop||def
  4959. SAY
  4960. usagelist=SHOWDIR(bbspath'Usage','F')
  4961. tempnum=FIND(usagelist,'USER.LOG')
  4962. IF tempnum>0 THEN usagelist=DELWORD(usagelist,tempnum,1)
  4963. usagelist=sortnumbers(usagelist)
  4964. SAY pen3'             - Total BBS Usage -'def
  4965. DO i=1 TO WORDS(usagelist)
  4966.   dateclip=STRIP(WORD(usagelist,i))
  4967.   IF i=1 THEN day1=dateclip||day1
  4968.   usageclip=countcheck(bbspath'Usage/'dateclip 0)
  4969.   usageclp=usageclip%60 usageclip//60
  4970.   mtime=30*23*60  /* we guess 1 hour a day for various maintenance */
  4971.   IF dateclip=LEFT(DATE('S'),6) THEN mtime=RIGHT(DATE('S'),2)*23*60
  4972.   dateclip=dateclip'01'
  4973.   line=RIGHT(DATE('M',dateclip,'S'),10) WORD(DATE(,dateclip,'S'),3)':'
  4974.   line=line RIGHT(WORD(usageclp,1),3) 'hours' RIGHT(WORD(usageclp,2),2)
  4975.   line=line 'minutes  = ' RIGHT(((usageclip*100)/mtime)%1,2) 'percent usage.'
  4976.   SAY line
  4977.   IF (i+10)//(linesperpage-3)=0 THEN
  4978.     IF waiting2() THEN LEAVE i
  4979. END
  4980. cmin=countcheck(bbspath'Numbers/Minutes' 0)
  4981. chr=cmin%60
  4982. cmin=cmin//60
  4983. hrz=chr
  4984. IF hrz<1 THEN hrz=1
  4985. IF day1>19900101 THEN
  4986.   DO
  4987.     hrz=1+DATE('I')-DATE('I',day1,'S')
  4988.     hrz=hrz*24
  4989.   END
  4990. SAY
  4991. SAY '     Total Connect Time Since First Logon [all users]:'
  4992. SAY RIGHT(chr,20) 'hours' RIGHT(cmin,2) 'minutes  = ' RIGHT(((chr*100)/hrz)%1,2) 'percent usage.'
  4993. SAY
  4994. CALL waiting2()
  4995. IF waitchar='Q' THEN RETURN
  4996. CALL bbsspace(15)
  4997. SAY RIGHT(comma(countcheck(bbspath'Numbers/Calls' 0)),15) 'completed calls.'
  4998. SAY
  4999. IF extdevs~='' THEN CALL showxdevs()
  5000. SAY RIGHT(comma(countcheck(bbspath'Numbers/Bytes.DownLoad' 0)),15) 'bytes  in' RIGHT(comma(countcheck(bbspath'Numbers/Files.DownLoad' 0)),7) 'files downloaded.'
  5001. SAY
  5002. SAY RIGHT(comma(countcheck(bbspath'Numbers/Bytes.UpLoad' 0)),15) 'bytes  in' RIGHT(comma(countcheck(bbspath'Numbers/LastFile' 0)),7) 'files uploaded.'
  5003. IF emailonline<0 THEN CALL countmail()
  5004. SAY RIGHT(comma(emailonline),15) 'online of' RIGHT(comma(countcheck(bbspath'Numbers/LastMail' 0)),7) 'private messages.'
  5005. SAY RIGHT(comma(grand),15) 'online of' RIGHT(comma(grand2),7) 'public messages.'
  5006. SAY RIGHT(comma(files.0),15) 'online of' RIGHT(comma(countcheck(bbspath'Numbers/LastFile' 0)),7) 'public files.'
  5007. SAY RIGHT(comma(WORDS(userlist)),15) 'active of' RIGHT(comma(countcheck(bbspath'Numbers/Users' 0)),7) 'user applications.'
  5008. SAY
  5009. SAY 'Your access level is 'level'  -  minimum sysop level is' sysoplevel
  5010. SAY
  5011. SAY '  You Have'
  5012. totmail=WORD(data.17,2)
  5013. IF ~DATATYPE(totmail,'N') THEN totmail=0
  5014. totmsg=0
  5015. DO ti=1 TO level
  5016.   temp=WORD(data.23,ti)
  5017.   IF DATATYPE(temp,'N') THEN totmsg=totmsg+WORD(data.23,ti)
  5018. END
  5019. SAY '   Written' RIGHT(comma(totmsg),14)'  public &' RIGHT(comma(totmail),8)'  private messages.'
  5020. totfiles=WORD(data.14,1)
  5021. IF ~DATATYPE(totfiles,'N') THEN totfiles=0
  5022. totbytes=WORD(data.14,3)
  5023. IF ~DATATYPE(totbytes,'N') THEN totbytes=0
  5024. SAY '  Uploaded' RIGHT(comma(totbytes),14)'  bytes in' RIGHT(comma(totfiles),8)'  files.'
  5025. totfiles=WORD(data.15,1)
  5026. IF ~DATATYPE(totfiles,'N') THEN totfiles=0
  5027. totbytes=WORD(data.15,3)
  5028. IF ~DATATYPE(totbytes,'N') THEN totbytes=0
  5029. SAY 'Downloaded' RIGHT(comma(totbytes),14)'  bytes in' RIGHT(comma(totfiles),8)'  files.'
  5030. PARSE VAR data.19 dhour' hours 'dmin' minutes in 'calls .
  5031. IF ~DATATYPE(dhour,'N') THEN dhour=0
  5032. IF ~DATATYPE(dmin,'N') THEN dmin=0
  5033. IF ~DATATYPE(calls,'N') THEN calls=0
  5034. SAY '..and been on' bbsname dhour 'hours' dmin+TIME('E')%60 'minutes in' calls+1 'calls.'
  5035. SAY
  5036. CALL waiting2()
  5037. IF waitchar='Q' THEN RETURN
  5038. CALL showmarked()
  5039. CALL logonstats()
  5040. nonstop=0
  5041. CALL waiting()
  5042. RETURN
  5043.  
  5044.  
  5045. countmail:
  5046. SAY 'Counting online email...'
  5047. emailonline=0
  5048. DO ti=1 TO WORDS(userlist)
  5049.   emailonline=emailonline+WORDS(SHOWDIR(bbspath'Email/'WORD(userlist,ti)))
  5050. END
  5051. RETURN
  5052.  
  5053.  
  5054. hourly:
  5055. IF level=99 & nonstop~=1 THEN
  5056.   DO
  5057.     IF getinput(1 1 'Zero The Hourly Averages? (Ny) > ')='Y' THEN
  5058.       ADDRESS COMMAND 'C:Delete >*' bbspath'Numbers/Hourly/#?'
  5059.     CALL cleanline(1)
  5060.   END
  5061. hc.=0
  5062. hc.24=countcheck(bbspath'Numbers/Hourly/Start' 0)
  5063. IF hc.24=0 THEN hc.25=1
  5064. ELSE hc.25=1+DATE('I')-hc.24
  5065. hc.26=countcheck(bbspath'Numbers/Hourly/Hour' 0)
  5066. hc.27=TIME('H')
  5067. DO i=0 TO 23
  5068.   temp=hc.25
  5069.   IF temp>1 & i>hc.27 THEN temp=temp-1
  5070.   hc.i=countcheck(bbspath'Numbers/Hourly/'i 0)%temp
  5071. END
  5072. IF hc.24=0 THEN hc.24=DATE('I')
  5073. SAY
  5074. SAY pen3'        Average minutes per hour of use each day since' DATE(,hc.24,'I')||def
  5075. line=' Hour:  ********10********20********30********40********50********60'
  5076. SAY line
  5077. DO i=0 TO 23
  5078.   IF i=0 THEN temp=12'am'
  5079.   ELSE IF i<12 THEN temp=i'am'
  5080.   ELSE IF i=12 THEN temp='12pm'
  5081.   ELSE temp=i-12'pm'
  5082.   SAY RIGHT(temp,5)':  'pen3||LEFT('*',hc.i,'*')||def
  5083.   IF i=(linesperpage-4) THEN CALL waiting2()
  5084. END
  5085. SAY line
  5086. DROP hc.
  5087. RETURN
  5088.  
  5089.  
  5090. logonstats:
  5091. IF level=0 THEN RETURN
  5092. SAY bak2||name||def 'Last on' DATE('W',lastondate,'I') DATE(,lastondate,'I') lastontime
  5093. tempnum=countcheck(bbspath'Numbers/LastFile' 0)-lastbrowse
  5094. IF tempnum>files.0 THEN tempnum=files.0
  5095. line='of' RIGHT(countcheck(bbspath'Numbers/LastFile' 0),6) 'public files uploaded.'def
  5096. IF tempnum>0 THEN SAY RIGHT(tempnum,6) '   new of' RIGHT(files.0,6) 'files online    'line
  5097. ELSE SAY '       No new' line
  5098. totmsg=0
  5099. grand=0
  5100. grand2=0
  5101. DO i=1 TO 99
  5102.   IF msg.i='' THEN ITERATE i
  5103.   CALL msgcount(i)
  5104.   totmsg=totmsg+unred
  5105.   grand=grand+totmsgs
  5106.   grand2=grand2+lastmess
  5107. END
  5108. line=RIGHT(grand2,6) 'public messages written'
  5109. IF totmsg>0 THEN
  5110.   SAY RIGHT(totmsg,6) '   new of' line',' grand 'messages online.'
  5111. ELSE SAY '       No new of' line'.'
  5112. IF level>sysoplevel THEN
  5113.   DO
  5114.     IF GETCLIP('BBS_screen')~=0 THEN
  5115.          SAY pen3' - BB screen is ON -'def
  5116.     ELSE SAY pen3' - BB screen is OFF -'def
  5117.   END
  5118. RETURN
  5119.  
  5120.  
  5121. readopen:
  5122. PARSE ARG fname
  5123. ok=OPEN(f,fname,'R')
  5124. IF ok~=0 THEN RETURN 1
  5125. line=fname 'failed to open for reading!'
  5126. SAY line
  5127. RETURN 0
  5128.  
  5129.  
  5130. writeopen:
  5131. PARSE ARG fname
  5132. CALL CLOSE(f)
  5133. ok=OPEN(f,fname,'W')
  5134. IF ok~=0 THEN RETURN 1
  5135. line=fname 'failed to open for writing!'
  5136. SAY line
  5137. RETURN 0
  5138.  
  5139.  
  5140. set_grand:
  5141. SAY 'Setting up public message conferences...'
  5142. grand=0
  5143. DO i=1 TO 99
  5144.   IF msg.i='' THEN ITERATE i
  5145.   msg.i.0=WORDS(SHOWDIR(msgpath||i,'F'))
  5146.   msg.i.1=STATEF(msgpath||i)
  5147.   grand=grand+msg.i.0
  5148. END
  5149. RETURN
  5150.  
  5151.  
  5152. SYNTAX:
  5153. FAILURE:
  5154. lin.1=pen7||ERRORTEXT(RC)||def
  5155. lin.2=SIGL-1     SOURCELINE(SIGL-1)
  5156. lin.3=SIGL pen7||SOURCELINE(SIGL)||def
  5157. lin.4=SIGL+1     SOURCELINE(SIGL+1)
  5158. DO er=1 TO 4
  5159.   SAY lin.er
  5160. END
  5161. IF newpassword='' THEN SIGNAL DONE2  /* no user logged on, quit quietly */
  5162. CALL CLOSE(f)
  5163. IF level>sysoplevel THEN
  5164.   DO
  5165.     junk=getinput(1 1 'ReStart: (Ny) > ')
  5166.     IF junk~='Y' THEN SIGNAL LOGOUT
  5167.   END
  5168. string=''
  5169. waitchar=''
  5170. IF data.1~='' & data.5~='' & data.20~='' THEN CALL savedata(0)
  5171. SIGNAL RESTART
  5172.  
  5173.  
  5174. BREAK_E:
  5175. CALL CLOSE(f)
  5176. SAY pen3'*** CTRL-E BREAK ***'def
  5177. waitchar=''
  5178. string=''
  5179. nonstop=0
  5180. rnonstop=0
  5181. brostop=0
  5182. i=999999
  5183. wi=999999
  5184. ni=0
  5185. RETURN 0
  5186.  
  5187.  
  5188. BREAK_C:
  5189. CALL CLOSE(f)
  5190.  
  5191. LOGOUT:
  5192. secs=TIME('E')
  5193. mins=secs%60
  5194. secs=TRUNC(secs//60)
  5195. IF secs<10 THEN secs='0'secs
  5196. SAY
  5197. SAY 'Public messages now online: 'RIGHT(comma(grand),9)
  5198. SAY 'Public    files now online: 'RIGHT(comma(files.0),9)
  5199. SAY
  5200. SAY 'Time used this call:' mins':'secs
  5201. SAY
  5202. arg=bbspath'BBS_TEXT/GOODBYE'
  5203. IF EXISTS(arg) THEN
  5204.   DO
  5205.     CALL DELAY(14)
  5206.     CALL readlines(arg 1)
  5207.     nonstop=1
  5208.     CALL seelines(0)
  5209.     nonstop=0
  5210.   END
  5211. SAY
  5212. IF bbsprefs.2 THEN CALL doGrin()
  5213. SAY 
  5214.  
  5215. OUT:
  5216. data.18=winnings
  5217.  
  5218. OUT2:
  5219.  
  5220. DONE:
  5221.  
  5222. DONE2:
  5223. IF newfilesflag=1 THEN
  5224.   DO
  5225.     newfilesdate=DATE('S') TIME()
  5226.     lastbrowse=countcheck(bbspath'Numbers/LastFile' 0)
  5227.   END
  5228. IF clear_marked=1 THEN data.24=''
  5229. CALL saveData(0)
  5230. IF sortuserflag=1 THEN
  5231.   DO
  5232.     CALL sortuserlist()
  5233.     IF SHOW('P','BBBBS') THEN
  5234.       DO
  5235.         CALL SETCLIP('BBS_mainusers')
  5236.         CALL SETCLIP('BBS_localusers',1)
  5237.       END
  5238.     sortuserflag=0
  5239.   END
  5240. IF sortalphaflag>0 | savefileflag>0 THEN
  5241.   DO
  5242.     IF savefileflag>0 THEN CALL savefilelist2()
  5243.     ELSE CALL savealphalist()
  5244.     IF SHOW('P','BBBBS') THEN CALL SETCLIP('BBS_localfiles',2)
  5245.   END
  5246. IF getinput(1 1 'Reset for next local user? (nY) > ')='N' THEN EXIT
  5247. clear_marked=0
  5248. data.=''
  5249. SIGNAL BIG_LOOP
  5250.  
  5251.  
  5252. checkclips:
  5253. IF GETCLIP('BBS_mainusers')~='' THEN
  5254.   DO
  5255.     CALL loaduserlist()
  5256.     CALL SETCLIP('BBS_mainusers')
  5257.   END
  5258. IF GETCLIP('BBS_mainfiles')~='' & GETCLIP('BBS_maint')='' THEN
  5259.   DO
  5260.     CALL SETCLIP('BBS_mainfiles')
  5261.     CALL loadfiles()
  5262.     CALL loadalpha()
  5263.   END
  5264. RETURN
  5265.  
  5266. /* bbsLOCAL.rexx */
  5267.  
  5268.  
  5269. /*  Userfile Data definitions */
  5270.  
  5271.  1 name
  5272.  2 address
  5273.  3 city state country zip
  5274.  4 telephone
  5275.  5 password
  5276.  6 protocol
  5277.  7 lines per page
  5278.  8 Preferences: MENUS COLOR STREET PHONE etc. On list=YES, ON or PUBLIC.
  5279.  9 Computer model
  5280. 10 interests        ! SYSOP edit only below this line !
  5281. 11 nn minutes n more times today  (typically 60 mins 3 times/day).
  5282. 12 first date on.  timestamp  Birthday: birthday
  5283. 13 last  date on BBS in 'S' form for rexx DATE().
  5284. 14 uploaded files bytes lastdate
  5285. 15 downloaded files bytes lastdate
  5286. 16 lastfilebrowsed lastfilelistdate lastfilelisttime
  5287. 17 ul:dl_ratio  total_email_written  last_email_read_(sysop only)
  5288. 18 winnings
  5289. 19 total time on this BBS in hours minutes calls
  5290. 20 level
  5291. 21 exclude dirs by name (conferences by number), separated by spaces.
  5292. 22 oldest messages read
  5293. 23 total msgs written per conference
  5294. 24 Marked message list  msgdirnum/msgnum
  5295. 25 filenumbers to download (temporary)
  5296.  
  5297. /* end data defines */
  5298.